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错误,具体解决方法如下 ...
随机推荐
- (原)tensorflow中使用指定的GPU及GPU显存
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6591923.html 参考网址: http://stackoverflow.com/questions ...
- Dubbo本地存根
在远程调用服务提供者的实现之前,如果需要做一些参数验证.缓存.判断.小功能等等,满足要求再调用服务提供者的远程服务,则我们可以通过编写一个本地存根来实现这种功能. (1).在公共项目中或服务消费者项目 ...
- ARMV8 Procedure Call Standard
1.前言 2. 术语说明 Term Note ABI Application Binary Interface 应用程序二进制接口 EABI Embedded ABI 嵌入式ABI PCS Pro ...
- David McCullough, Jr.为韦斯利高中毕业生演讲〈你并不特别〉
Dr. Wong, Dr. Keough, Mrs.Novogroski, Ms. Curran, members of the board of education, familyand frien ...
- ES系列五、ES6.3常用api之搜索类api
1.搜索api 1.1.routing:路由 执行搜索时,它将广播到所有索引/索引分片(副本之间的循环).可以通过提供routing参数来控制将搜索哪些分片.例如,在索引book时,路由值可以是nam ...
- PNG,JPEG,BMP,JIF图片格式详解及其对比
原文地址:http://blog.csdn.net/u012611878/article/details/52215985 图片格式详解 不知道大家有没有注意过网页里,手机里,平板里的图片,事实上,图 ...
- [BZOJ3295] [Cqoi2011]动态逆序对(带修改主席树)
题目描述 对于序列A,它的逆序对数定义为满足i<j,且Ai>Aj的数对(i,j)的个数.给1到n的一个排列,按照某种顺序依次删除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序 ...
- js导出excel表格中较长数字串会变成科学计数法问题
在做项目中,遇到导出excel表格时,银行账户号数字过长,导出的数字串变为计数法形式,如下图: 网上搜到解决方法,粘贴到这以供学习.不断更新. 原博地址:http://www.cnblogs.com/ ...
- MariaDB:删除数据库报错:error: 'Error dropping database (can't rmdir './shiro', errno: 39)'
今天在删除一个库的时候报错,如下图所示. 删除命名:mysqladmin –u root –p drop shiro 解决办法: 删除./shiro目录下面的所有文件和目录. 重新执行删除命令即可!
- HashMap Hashtable LinkedHashMap 和TreeMap
Map主要用于存储健值对,根据键得到值,因此不允许键重复(重复了覆盖了),但允许值重复.Hashmap 是一个最常用的Map,它根据键的HashCode值存储数据,根据键可以直接获取它的值,具有很快的 ...

