Infinite loop in Camel - Rabbit MQ

Deadly 提交于 2019-12-06 15:20:10

Resolution:

Changed the uri added BridgedEndpoint=true. I do not understand the mechanics behind that, and why such extra complications for rabbitmq specifically. If I use jboss-fuse/camel I should expect the same issue?

queue.url.input_queue=rabbitmq://localhost:5672/ex1?queue=input_queue&routingKey=input_queue&connectionFactory=#customConnectionFactory&autoDelete=false&autoAck=true&BridgeEndpoint=true
queue.url.output_queue=rabbitmq://localhost:5672/ex1?queue=output_queue&routingKey=output_queue&connectionFactory=#customConnectionFactory&autoDelete=false&autoAck=true&BridgeEndpoint=true

I had the same problem and it is fixed by adding between input and output (http://camel.apache.org/constant.html):

.setHeader("rabbitmq.ROUTING_KEY", constant("output_queue"))

According http://camel.apache.org/rabbitmq.html:

The routing key to use when binding a consumer queue to the exchange. For producer routing keys, you set the header (see header section)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!