littlersmall / rabbitmq-access

rabbitmq手动确认模式java封装

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

【增加topic模式】求教楼主如何直接通过setType("topic")修改为topic模式

congjianan opened this issue · comments

image
像图上这样在PoolExample中添加setType(“topic”)但是一直报如下的错:
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 'example' in vhost '/': received 'topic' but current is 'direct', class-id=40, method-id=10)

这个需要在创建的时候第一次就指定为topic
不能前面是direct创建的,后面改代码想把这个改成topic的。。。

楼主咋改的,能指教下吗?这是我的又一错误示范 _
image
image
image
image
只是启动PoolExample的main方法就报错,
报错信息:
1.

reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'example' in vhost '/': received 'topic' but current is 'direct', class-id=40, method-id=10

Error creating bean with name 'senderExample': Invocation of init method failed; nested exception is java.io.IOException