How to setup transaction in Camel JMS Route
问题 How do I setup transaction in JMS route to rollback or not consume a message when an exception occurs. Below is my route. MQ is ActiveMQ. from("jms:queue:myQueue") .routeId("myRoute") .doTry() .toF("reactive-streams:myStream") .doCatch(Exception.class) .process(exchange -> exchange.getFromEndpoint().stop()) .end();` 回答1: Simply adding transacted did the job! Also, had to enable connection pooling and camel-jms-starter (for default factories). from("jms:queue:myQueue?transacted=true") .routeId