camel-jms

How to setup transaction in Camel JMS Route

青春壹個敷衍的年華 提交于 2020-07-10 07:02:23
问题 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

How do I set a component parameter of type object to a route using Java DSL?

夙愿已清 提交于 2020-01-06 07:07:22
问题 My objective is to use Camel along with its JMS component. The route config looks like below- from("jms:queue:test").to(mybean) I would like to add the option of kind 'parameter' and type 'object' to this route -for example the option 'jmsMessageType'. I saw some other posts that talks about using setProperty() on route definition but I could not find a definite answer. Options of type 'string' and numbers can be appended to the URI but not objects. JMS has an option of taskExecutor but how