osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in MQTT Apache Camel route causes application to stop


Hi all,

First post in the email list, just let me know if I do something wrong :-)

I'm having trouble with MQTT and Apache Camel. I have configured a couple of routes to dispatch messages from JMS to MQTT and viceversa. The JMS client works as excepted and whenever there is a failure in the initial connect or any further reconnect it is managed gracefully, so that the route keeps working. The problem comes with MQTT client, which causes a RuntimeException raised up to the top layer, so that the application stops.

I believe this shouldn't be the correct behaviour and the exception should be handled within the route so that it keeps working. This can be easily reproducer running a route with the MQTT broker down, it throws the exception to the Main class after the 10 seconds timeout elapses. I have checked the same code with the Paho client instead of plain MQTT client and it works fine, similar to JMS client I'm not sure if it is something realted to the internal implementation of the MQTT client or the wrapper of Apache Camel.

I am using Java 8, Apache Camel 2.2.0 and Spring xml configuration.

Anybody could give me some help / advice on this topic please?

Please find more discussion details in this Stackoverflow topic:

https://stackoverflow.com/questions/53546604/error-in-mqtt-apache-camel-route-causes-application-to-stop

Thanks in advance!

Best regards,

Dani