camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanson2010 <>
Subject Transaction configuration in Java DSL
Date Thu, 18 Nov 2010 10:07:30 GMT

What I'm trying to do is moving data from IBM MQ to ActiveMQ, and ensuring no
data lost during network failure or something like that. So TRANSACTION
comes into my mind. But I can't get it run in Java DSL. (Spring DSL will be
okay strangely.)

Camel 2.5.0
IBM MQ 7.0.1
ActiveMQ 5.4.1

CamelContext camel = new DefaultCamelContext();
JmsComponent wmq = JmsComponent.jmsComponentTransacted(mqConnectionFactory);
camel.addComponent("wmq", wmq);
try {
	camel.addRoutes( new RouteBuilder() { 
		public void configure() { 
			from("amq:TEST1").process(new Processor() {
				public void process(Exchange e) {
				System.out.println("Received exchange: " + e.getIn().getBody());
} catch (Exception e) {
	logger.error("Exception in camel: " + e.getMessage());

Error is like this:
[main] ERROR: Exception in camel: Failed to create route route1 at: >>>
Policy[ref:null] <<< in route: Route[[From[wmq:QL_TEST1]] ->
[Policy[ref:null]]] because of policy must be specified on: Policy[ref:null]

If I remove the .transacted() line, everything will be okay.

BTW, how can I configure the retry interval? During "network failure", the
error log file size surges really fast!

Thanks in ad!
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message