当前位置:   article > 正文

Caused by: com.rabbitmq.client.ShutdownSignalException: channel error;_received 'topic' but current is 'direct

received 'topic' but current is 'direct

在创建topic类型的rabbitmq交换机时,出现这个错误
received ‘topic’ but current is ‘direct’, 说明类型设置错误,我重新检查了一遍代码,发现没有问题,重启idea也没有用。
后来查询rabbitmq管理台发现,原来设置过一次类型为direct的exchange,因此修改代码后,将类型改为topic后运行会报错。
解决方法也很简单,将原来的exchange删掉重新设置,或者换个名字就好

Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; 
protocol method: #method<channel.close>
(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'topic_exchange' in vhost '/xzk': 
received 'topic' but current is 'direct', class-id=40, method-id=10)
	at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:516)
	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346)
	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:182)
	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:114)
	at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:672)
	at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48)
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:599)
	at java.base/java.lang.Thread.run(Thread.java:834)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号