Apache Camel + RabbitMQ. Endpoint not creating

2.1k views Asked by At

I have created project, that contains only route settings for rabbitmq.

<route>
    <from uri="rabbitmq:localhost/test_out_ex?queue=test_out&amp;autoDelete=false&amp;username=admin&amp;password=admin"/>
    <to uri="rabbitmq:localhost/test_in_ex?queue=test_in&amp;autoDelete=false&amp;username=admin&amp;password=admin"/>
</route>

I run it on tomcat and Camel creates only "from"-endpoint, not "to" (I look it in rabbitMq web interface). Why? Because, "to" hasn't got consumers?

more details:

Problem is messages aren't saved in output message queue. It's a normal situation, when application has send message to queue, which hasn't got consumer online at this time, so it should save message, until consumer connects.

So, I defined simple route and deploy it on tomcat, also I deployed Jolokia project to monitor my camel context via Hawtio. Hawtio shows me, that route is created and consists of two endpoints. Then I publish message via RabbitMq web-interface to 'test_out'. Hawtio shows me, that it reaches 'test_in' queue, but in RabbitMq web-interface (or rabbitmqctl) 'test_in' queue doesn't exists, so after server restarts message gone.

1

There are 1 answers

3
Willem Jiang On

We need to filter the message headers which could cause some trouble when routing from the test_out to test_in.

<route>
    <from uri="rabbitmq:localhost/test_out_ex?queue=test_out&amp;autoDelete=false&amp;username=admin&amp;password=admin"/>
    <removeHeader pattern="rabbitmq.*"/>
    <to uri="rabbitmq:localhost/test_in_ex?queue=test_in&amp;autoDelete=false&amp;username=admin&amp;password=admin"/>
</route>