Solution for unable to create "dead-letter-exchange" in RabbitMQ
在参考 Dead-Letter-Exchange 进行Dead-letter-exchange的理解,
在本地时,想要创建 Dead-letter-exchange 时,一直报错,错误如下:
Unhandled Exception: RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'q_test' in vhost '/': received the value 'q-dead-letter-exchange' of type 'longstr' but current is none", classId=50, methodId=10, cause=
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.QueueDeclare(String queue, Boolean passive, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary`2 arguments)
at RabbitMQ.Client.Impl.AutorecoveringModel.QueueDeclare(String queue, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary`2 arguments)
at CNBlogs.Question.EventBusRabbitMQ.EventBusRabbitMQ.CreateConsumerChannel()
去官网查了查,姿势也正确,先声明一个Exchange
channel.ExchangeDeclare("q-dead-letter-exchange", type: "direct");
然后再指定 x-dead-letter-exchange 参数
var args = new Dictionary<string, object>()
{
{"x-dead-letter-exchange", "q-dead-letter-exchange"}
};
最后放到队列声明里面:
channel.QueueDeclare(queue: _queueName,
durable: true,
exclusive: false,
autoDelete: false,
arguments: args);
然而,每次一运行就报上面那个错误,最后子啊Github上找到了答案
原因可能是我原来的队列中,因为有尚未确认的消息在。然后,把RabbitMQ 中的Queue 和Exchange 删除,重新运行程序就成功了。下面是Queue和Exchange 的截图
Solution for unable to create "dead-letter-exchange" in RabbitMQ的更多相关文章
- ORA-09925: Unable to create audit trail file汇总
今天一兄弟的库报ORA-09925: Unable to create audit trail file,当时查 df -h有可用空间,文件夹的权限也正确,未df -i查看Inodes使用情况,审计文 ...
- ODA: After Apply ODA 12.2.1.2.0 Patch, Unable to Create TableSpace Due to [ORA-15001: diskgroup "DATA" does not exist or is not mounted | ORA-15040: diskgroup is incomplete] (Doc ID 2375553.1)
ODA: After Apply ODA 12.2.1.2.0 Patch, Unable to Create TableSpace Due to [ORA-15001: diskgroup &quo ...
- Fatal error in launcher Unable to create process using 'dapppythonpython37python
Fatal error in launcher: Unable to create process using '"d:\app\python\python37\python.exe&quo ...
- 【Azure 服务总线】Azure Service Bus中私信(DLQ - Dead Letter Queue)如何快速清理
在博文ServiceBus 队列中死信(DLQ - Dead Letter Queue)问题一文中,介绍了服务总线产生私信的原因及可以通过代码的方式来清楚私信队列中的消息,避免长期占用空间(因为私信中 ...
- 记一次tomcat线程创建异常调优:unable to create new native thread
测试在进行一次性能测试的时候发现并发300个请求时出现了下面的异常: HTTP Status 500 - Handler processing failed; nested exception is ...
- 解决Unable to create new native thread
两种类型的Out of Memory java.lang.OutOfMemoryError: Java heap space error 当JVM尝试在堆中分配对象,堆中空间不足时抛出.一般通过设定J ...
- ArcEngine编辑保存错误:Unable to create logfile system tables
通过ArcEngine对多个SDE中多个图层进行批量编辑处理,其中有部分图层在结束编辑的时候出现错误提示(部分图层可以,只有两个数据较多的图层保存失败). 错误信息:Unable to create ...
- Fatal error in launcher: Unable to create process using '"'
今天遇到了 Fatal error in launcher: Unable to create process using '"' 这个问题,原来是我上次装python3.5的时候,pyth ...
- Genymotion创建下载模拟器的时候出现Unable to create Genymotion virtual devices:Connection timeout错误
如图,如果Genymotion创建下载模拟器的时候出现Unable to create Genymotion virtual devices:Connection timeout错误,具体解决方法如下 ...
随机推荐
- SpringMVC——SpringMVC简介
Spring web mvc 和Struts2 都属于表现层的框架,它是Spring 框架的一部分,我们可以从Spring 的整体结构中看得出来:
- groovy与java中的多方法
最近在学习groovy的时候从书里看到这么一个有趣的例子,刚开始我也猜错了: 最后测试答案是: son ----show 刚开始没理解,以为是num---show,但是后来看书上说是: test01接 ...
- AD域相关的属性和C#操作AD域
“常规”标签 姓 Sn 名 Givename 英文缩写 Initials 显示名称 displayName 描述 Description 办公室 physicalDeliveryOfficeNam ...
- 对HUAWEI-ManagedProvisioning的一次不完整分析
分析思路 关注点1:AndroidManifest.xml是Android应用的入口文件,包含有APP服务的权限.广播和启动位置. 关注点2:涉及到修改系统的函数,setWifiEnabled().I ...
- grep用法【转】
简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它 ...
- 对WinMain程序入口函数返回值为msg.wParam的几点理解
原文地址:http://blog.csdn.net/setflvet/article/details/6983224 1.在WinMain主函数中,最后的返回值是msg.wParam,这个参数是传递给 ...
- redis学习笔记(面试题)
1. 什么是redis Redis是一个数据库,他和我们传统的oracle数据库差别是它是基于内存的数据库:因为是基于内存,所以效率就高,在某些场景下就可以对我们传统的关系型数据库做一个补充 2. r ...
- 安装installshield问题
install designer中 general information 选择setup languages shortcuts编辑 开始 中显示目录 文件路径 C:\Program Files ...
- nginx实现tomcat的负载均衡及企业内部应用的代理
192.168.3.87 mysql+redis+tomcat 192.168.3.112 nginx:6688 192.168.3.86 nginx+h5 环境准备 a.安装包 open jd ...
- 转载:2.2.2 配置项的语法格式《深入理解Nginx》(陶辉)
原文:https://book.2cto.com/201304/19627.html 从上文的示例可以看出,最基本的配置项语法格式如下: 配置项名 配置项值1 配置项值2 - ; 下面解释一下配置项的 ...

