You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by soadb <da...@gmail.com> on 2015/04/10 16:58:15 UTC

Rollback JMS messages consumed with ConsumerTemplate?

I have a requirement to create a file based on messages queued in AMQ.  This
route is initiated by a web service call which then uses a bean that
consumes the messages from multiple queues using a ConsumerTemplate.

		<route id="route.buildReconFile">
			<from
uri="seda:buildReconFile?concurrentConsumers=1&amp;waitForTaskToComplete=Never"
/>
			<setExchangePattern pattern="InOnly" />
			<bean ref="logEventCollector" method="getLogEvents" />
		</route>

Within the bean:

		event = consumer.receiveBody(queueName, 2000, LogEvent.class);

This is all working fine.  The situation I'd like to handle is when the file
creation encounters an exception for whatever reason, the messages are
places back on the original JMS queues.

Since this is not a from:active-mq route, I am not sure how to
commit/rollback in the context of the ConsumerTemplate.

Is my only option to reinsert the messages on exception manually?






--
View this message in context: http://camel.465427.n5.nabble.com/Rollback-JMS-messages-consumed-with-ConsumerTemplate-tp5765606.html
Sent from the Camel - Users mailing list archive at Nabble.com.