camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leber, Thomas" <>
Subject Routing Slip + InOutPattern + Transaction does not work
Date Thu, 02 Mar 2017 11:48:11 GMT

I'm trying to use a Routing Slip with the InOut pattern. Also I have the requirement to transact
the whole system. I have set up a small example but I won't run.
The message stays inside the "producer" queue and will not be Picked up by the "_route1" or

When I'm commenting the line "<property name="transacted" value="true" />" from the
ActiveMq Component, it works fine, but then nothing is transacted.

Also the line: <setExchangePattern id="_setExchangePattern1" pattern="InOnly" /> does
not reset the JMSReply to header, so every other following queue will try to send a reply
to this temp queue.

Any ideas how to solve 
a. that I can user Transaction, InOut Pattern and a routing slip.
b. that the JMSReply header is reset. I know I can use removeHeaders, but it looks a bit as
a bug for me...


<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="" xmlns:amq=""
xmlns:cm="" xmlns:xsi=""
	<!-- Active MQ General Properties -->
	<bean id="policy" class="org.apache.activemq.RedeliveryPolicy">
		<property name="maximumRedeliveries" value="-1" />

	<!-- Active MQ Properties Z-SM -->
	<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
		<property name="connectionFactory" ref="activemq-factory" />

	<bean id="required" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
		<property name="transactionManager" ref="jmsTransactionManager" />
		<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" />

	<bean class="org.apache.activemq.camel.component.ActiveMQComponent" id="activemq">
		<property name="connectionFactory" ref="activemq-factory" />
		<property name="transacted" value="true" />

	<bean class="org.apache.activemq.ActiveMQConnectionFactory" id="activemq-factory">
		<property name="brokerURL" value="tcp://localhost:61617" />
		<property name="userName" value="admin" />
		<property name="password" value="admin" />

	<!-- Property configuration -->
	<cm:property-placeholder id="placeholder" persistent-id="routeconfig-routeslipconfig"
			<cm:property name="routing.slip" value="activemq:queue:ExcutionProcessA,activemq:queue:ExcutionProcessB"
	<camelContext id="routingSlipContext" xmlns="">
		<propertyPlaceholder id="properties" location="blueprint:placeholder" />

		<route id="producer">
			<from id="_from1" uri="timer:mytimer?delay=2000" />
			<transacted ref="required" />
			<to uri="activemq:queue:producer" />

		<route id="routingSlip">
			<from uri="activemq:queue:producer" />
			<setBody id="_setBody1">
			<setHeader headerName="queue1">
			<setHeader headerName="queue2">
			<setExchangePattern id="_setExchangePattern1" pattern="InOut" />
			<routingSlip id="_routingSlip1">
			<setBody id="_setBody5">
				<simple>${body} -&gt; main route</simple>
			<setExchangePattern id="_setExchangePattern1" pattern="InOnly" />
			<log id="_log1" message="${body}" />
			<log id="_log2" message="$simple{headers}" />
			<to id="_to1" uri="activemq:queue:output" />

		<route id="mocker">
			<from uri="activemq:queue:output" />
			<to uri="mock:done" />

		<route id="_route1">
			<from id="_from2" uri="activemq:queue:ExcutionProcessA" />
			<setBody id="_setBody2">
				<simple>${body} -&gt; route 1</simple>
			<log id="_log3" message="consumer 2" />
			<setHeader headerName="route1" id="_setHeader1">

		<route id="_route2">
			<from id="_from3" uri="activemq:queue:ExcutionProcessA" />
			<setBody id="_setBody3">
				<simple>${body} -&gt; route 1</simple>
			<log id="_log4" message="consumer 1" />
			<setHeader headerName="route1" id="_setHeader2">

		<route id="_route3">
			<from id="_from4" uri="activemq:queue:ExcutionProcessB" />
			<setBody id="_setBody4">
				<simple>${body} -&gt; route 2</simple>
			<setHeader headerName="route2" id="_setHeader3">

View raw message