You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Greenbean <Ke...@ngc.com> on 2010/11/09 16:25:07 UTC

Camel Transacted Routes With ActiveMQ And Bitronix

Reposting after subscribing to mail list...

I am getting an error when using Camel to consumer a JMS message in a FROM
as part of a route in a JTA transactions using Bitronix.  The error below
appears when "allowLocalTransactions" in Bitronix is false.  If I set
"allowLocalTransactions" to true, then I don't see the error.  However,
since I am using JTA, my route is set to transacted, and my connection
factory objects are XA, I thought I should not need local transactions.  I
am using a similar setup without Camel (using the
DefaultMessageListenerContainer directly), and it works as expected with JTA
and "allowLocalConnections" set to false.  Do I have something in my camel
configuration set incorrectly? 

Error: 
2010-11-08 21:32:34,304 WARN 
[org.springframework.jms.listener.DefaultMessageListenerContainer]
(threadPoolExecutor-0) Setup of JMS message listener invoker failed for
destination 'DLQ.processorQueue' - trying to recover. Cause: error enlisting
a MessageConsumerWrapper of a DualSessionWrapper in state ACCESSIBLE of a
JmsPooledConnection of pool activemq-activeMQJmsFactory in state ACCESSIBLE
with underlying connection ActiveMQConnection
{id=ID:csnwas6-25037-1289251901943-0:5,clientId=ID:csnwas6-25037-1289251901943-6:0,started=true} 
--------------------------------------------------------------- 

Software: 
Camel 2.4.0 
ActiveMQ 5.4.0 
Bitronix 2.0.1 
--------------------------------------------------------------- 
<camel:route errorHandlerRef="transactionErrorHandler"> 
            <camel:from 
               
uri="activeMQComponent:queue:DLQ.processorQueue?concurrentConsumers=1" /> 
            <camel:transacted ref="PROPAGATION_REQUIRED_POLICY" /> 
            <camel:doTry> 
                <camel:process ref="exceptionThrowingProcessor" /> 
                <camel:doCatch> 
                   
<camel:exception>org.springframework.dao.DataAccessException</camel:exception> 
                   
<camel:exception>org.springframework.dao.DataRetrievalFailureException</camel:exception> 
                   
<camel:exception>com.InvalidDataException</camel:exception> 
                    <camel:exception>java.lang.Throwable</camel:exception> 
            <camel:to uri="bean:exchangeComboUtilities?method=translateTo"
/> 
                    <camel:marshal ref="xstream-default"/> 
                    <camel:setHeader headerName="marshalledMessage"> 
                        <camel:mvel>request.body</camel:mvel> 
                    </camel:setHeader> 
                    <camel:setBody> 
                       
<camel:mvel>request.headers.ORIGINAL_PAYLOAD</camel:mvel> 
                    </camel:setBody> 
                    <camel:to
uri="bean:errorProcessor?method=handleProcessingException" /> 
                </camel:doCatch> 
            </camel:doTry> 
        </camel:route> 
--------------------------------------------------------------- 
    <bean id="activeMQComponent"
class="org.apache.activemq.camel.component.ActiveMQComponent"> 
         <property name="connectionFactory" ref="activeMQJmsFactory"/> 
        <property name="transacted" value="true" /> 
        <property name="transactionManager" ref="transactionManager" /> 
        <property name="acknowledgementModeName" value="TRANSACTED" /> 
        <property name="taskExecutor" ref="concurrentTaskExecutor" /> 
    </bean> 
--------------------------------------------------------------- 
    <bean id="activeMQJmsFactory"
class="bitronix.tm.resource.jms.PoolingConnectionFactory" init-method="init" 
        destroy-method="close"> 
        <property name="className"
value="org.apache.activemq.ActiveMQXAConnectionFactory" /> 
        <property name="uniqueName" value="activemq-activeMQJmsFactory" /> 
        <property name="maxPoolSize" value="35" /> 
        <property name="twoPcOrderingPosition" value="-1" /> 
        <property name="allowLocalTransactions" value="false" /> 
        <property name="driverProperties"> 
            <props> 
                <prop key="brokerURL">failover:tcp://localhost:61616</prop> 
            </props> 
        </property> 
    </bean> 
---------------------------------------------------------------  


-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Transacted-Routes-With-ActiveMQ-And-Bitronix-tp3257037p3257037.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: EXTERNAL:Re: Camel Transacted Routes With ActiveMQ And Bitronix

Posted by Greenbean <Ke...@ngc.com>.
I worked with the developer on Bitronix.  He provided a fix in
BTM-2.1.1.  It looks like the Bitronix web site is still at BTM-2.1.0.
You might want to ask for 2.1.1 to be released.  The fix might be in the
source repository as well.

 

 

 

From: waterback [via Camel]
[mailto:ml-node+3347996-901122087-24942@n5.nabble.com] 
Sent: Wednesday, January 19, 2011 10:11 AM
To: Urciolo, Kevin J (IS)
Subject: EXTERNAL:Re: Camel Transacted Routes With ActiveMQ And Bitronix

 

Hello Greenbean, 

sorry i have no solution since i have a very similar problem... 
Do you have some sort of solution? 

Thanx, 
Martin 

________________________________

If you reply to this email, your message will be added to the discussion
below:

http://camel.465427.n5.nabble.com/Camel-Transacted-Routes-With-ActiveMQ-
And-Bitronix-tp3257037p3347996.html 

To unsubscribe from Camel Transacted Routes With ActiveMQ And Bitronix,
click here
<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubs
cribe_by_code&node=3257037&code=S2V2aW4uVXJjaW9sb0BuZ2MuY29tfDMyNTcwMzd8
MTc2MDkyNzEzMw==> . 


-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Transacted-Routes-With-ActiveMQ-And-Bitronix-tp3257037p3348076.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Transacted Routes With ActiveMQ And Bitronix

Posted by waterback <ma...@innoq.com>.
Hello Greenbean,

sorry i have no solution since i have a very similar problem...
Do you have some sort of solution?

Thanx,
Martin
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-Transacted-Routes-With-ActiveMQ-And-Bitronix-tp3257037p3347996.html
Sent from the Camel - Users mailing list archive at Nabble.com.