Firstly, if you are planing to use Camel route to consume the message from a queue and send it to another queue, then you do not need to configure <jms:consumer> endpoint of servicemix-jms component. You just need to use Camel jms endpoint in your route like:
The transaction will start from camel jms consumer endpoint and end with the whole route. So any exception thrown from the route will cause the message to be rolled back, hence not dequeued.
I read about your note below regarding using queue directly intsead of creating smx4 jms consumer to route message from the queue.
I have a scenario where I read messages from a queue then using camel recipient list pattern I dynamically route to an external webeservice based on the url embedded inside the message.
I am still not sure in which scenarios we should go for creating smx jms consumer as an endpoint instead of using queue as an endpoint for the camel router.
I am trying to understand pros and cons of using smx jms consumer. And if I use it as my endpoint then how would go with transaction. Shuld I start atransaction from jms consumer as XA which will pass alng to the camel router?