Hi

Why is resequencer compatible with JMS transaction and not the multi-cast
parallel Processing ?

Regards
Hervé

On Wed, Feb 15, 2012 at 2:57 PM, Hervé BARRAULT <[email protected]>wrote:

> Hi,
>
> I asked a question about JMS and transaction and had the following answer :
> Spring Transaction does not support using multiple threads. The
> transactional work should be done in the same thread, from spring TX
> manager point of view.
>
> I have some difficulties to understand why resequencer support JMS
> transaction and not the couple multicast / parallelProcessing :
>
> JMS transaction working but new thread in resequence (BatchSender)
>
> from("activemq:queue:in1").transacted().resequence().header("num").stream().timeout(2000L).to("activemq:queue:out1");
>
> JMS transaction not working as new threads for parallelProcessing
>
> from("activemq:queue:in2").transacted().multicast().parallelProcessing().recipientList(header("MY_HEADER")).end();
>
> Can I have a clarification for this point ?
>
> Regards
>
> Hervé
>
>
>
>
> On Tue, Feb 14, 2012 at 4:57 PM, Babak Vahdat <[email protected]
> > wrote:
>
>> Hi
>>
>> That's indeed possible even if you make use of the *transactional* JMS.
>>
>> I already verified it using one of the Camel's own unit tests (you could
>> also give it a try as well if you want).
>>
>> I changed [1] as the following (note the newly introduced transacted()
>> DSL):
>>
>>
>> from("activemq:queue:in1").transacted().resequence().body().batch().size(100).timeout(10000L).to("mock:result");
>>
>> from("activemq:queue:in2").transacted().resequence().header("num").stream().timeout(2000L).to("mock:result");
>>
>> And by [2] I marked the jmsConfig Bean to be *transacted*:
>>
>>        <property name="transacted" value="true"/>
>>
>> And as a side effect of this change I also had to add a Spring
>> PlatformTransactionManager:
>>
>>    <bean id="transactionManager"
>> class="org.springframework.jms.connection.JmsTransactionManager">
>>        <property name="connectionFactory" ref="jmsConnectionFactory"/>
>>    </bean>
>>
>> So that you don't have to spawn your own threads or the like.
>>
>> [1]
>>
>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsResequencerTestRouteBuilder.java
>> [2]
>>
>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/issues/JmsResequencerTest-context.xml
>>
>> Babak
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Resequencer-EIP-tp5482502p5482841.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

Reply via email to