Dear All,
I am trying to use transaction in servicemix 3.4. For the beginning I use
Seda flow and send message exchanges synchronous. I have developed an
example, which forward a received jms message to a file sender endpoint.
<bean id="connectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="tcp://localhost:61616" />
</bean>
</property>
<property name="maxConnections" value="10" />
<property name="maximumActive" value="10" />
</bean>
<jms:consumer service="ce:MyConsumerService3"
endpoint="MyConsumerEndpoint3"
destinationName="my.queue"
connectionFactory="#connectionFactory"
targetService="proj:fileSender"
targetInterface="proj:fileSender"
targetEndpoint="request"
targetOperation="executeReport"
transacted="xa"
synchronous="true"
sessionAcknowledgeMode="1"/>
Somehow the example seems to work. The jms message will be stored in a Mysql
Database.
If I deny write access of the target folder of the file sender, the jms
message keep store in the queue (database).
In case I remove the transaction="xa" from the jms:consumer definition the
jms message will also be removed from the queue if the file could not be
written because access has denied.
Does someone can conform my that this is the desired behaviour of xa
transactional jms consumer! I wonder if it is enough to just enable
transaction for the jms consumer as the message exchanges are send
synchronous to the next endpoint and do not care about the nmr. Or does the
messages in the nmr also have to handled transactive (e.g. get persists)
Further I tried to use the transaction started by the jms consumer by own
service endpoint. With in this component I access the transaction by
getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME).
If I am checking the Transaction, I wonder why the activemq resource hasn't
been enlisted to the transaction ( I have set
autoEnlistInTransaction="true")?
Any way, I am only able to call my service endpoint once. It seems that
something is blocking the messages. Is it possible that the transaction
hasn't complete properly (I commit transaction retrieved from the
MessageExchange by calling
getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME)) and cause
therefore a deadlock?
Thank you all,
best regards andreas
--
View this message in context:
http://old.nabble.com/transaction-servicemix-3.4-tp28532633p28532633.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.