我的印象是 RabbitAdmin
“默认情况下会自动查找 Queue、Exchange 和 Binding 类型的 bean,并代表用户向代理声明它们”
在我看来,如果我已经在代理上声明了多个队列,如果我添加了一个未声明的新队列,管理员将在声明它时遇到问题,抛出:-
Code:
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'TranslationQueue.local' in vhost '/', class-id=50, method-id=10), null, ""}
RabbitMQ xml 配置:
代码:
<bean id="rcf" class="com.rabbitmq.client.ConnectionFactory">
<property name="host" value="${rabbitmq.host:localhost}"/>
<property name="requestedHeartbeat" value="10" />
</bean>
<rabbit:connection-factory id="connectionFactory" host="${rabbitmq.host:localhost}" port="${rabbitmq.port:5672}"
username="guest" password="guest" connection-factory="rcf" />
<rabbit:admin connection-factory="connectionFactory" />
<rabbit:queue name="TranslationQueue.${server.name:unknown}" >
<rabbit:queue-arguments value-type="java.lang.Long">
<entry key="x-message-ttl" value="2400000" />
</rabbit:queue-arguments>
</rabbit:queue>
这是一个已知问题还是某种配置错误?