activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MaximeBelanger <>
Subject problem configuring durable subscriber with Spring and Atomikos (XA issue?)
Date Mon, 16 Jul 2012 15:18:56 GMT

I am not sure if this is an ActiveMQ issue, but my search so far as turned
up empty, so I have to start somewhere.
I am trying to setup a DefaultMessageListenerContainer using an ActiveMq
Durable subscriber (ActiveMQ 5.6.0), and Atomikos as TX manager for JTA,
configuring everything through Spring. I need to specify a clientId on the
connection for the durable subscriber. This is my config:
		<property name="connectionFactory" ref="jmsListenerConnectionFactory" />
		<property name="concurrentConsumers" value="1" />
		<property name="destinationName" value="" />
		<property name="durableSubscriptionName" value="" />
		<property name="subscriptionDurable" value="true" />
		<property name="messageListener" ref="integrationMdp" />
		<property name="transactionManager" ref="JtaTransactionManager" />
		<property name="sessionAcknowledgeModeName" value="CLIENT_ACKNOWLEDGE" />
		<property name="pubSubDomain" value="true" />
		<property name="sessionTransacted" value="true" />
		<property name="clientId" value="msgListener" />

	<bean id="jmsListenerConnectionFactory"
		<property name="uniqueResourceName" value="ActiveMQXAListener"/>
		<property name="maxPoolSize" value="1"/>
		<property name="xaConnectionFactory">
			<bean class="org.apache.activemq.ActiveMQXAConnectionFactory">
				<property name="brokerURL" value="${jms.brokerURL}"  />
				<property name="userName" value="${jms.username}" />
				<property name="password" value="${jms.password}" />
		<property name="localTransactionMode" value="false"></property>

If I do this, I will get the following exception:

[org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN 
com.atomikos.jms.AbstractJmsProxy  - Failed to create durable
TopicSubscriber: null 
javax.jms.JMSException: You cannot create a durable subscriber without
specifying a unique clientID on a Connection

On the other hand, if I set the clientId on the connectionFactory, I get the

[org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN 
com.atomikos.jms.AbstractJmsProxy  - Could not create an XASession on the
javax.jms.XAConnectionFactory's XAConnection - check if your JMS backend is
configured for XA? 
javax.jms.InvalidClientIDException: Broker: localhost - Client: msgListener
already connected from tcp://
[org.springframework.jms.listener.DefaultMessageListenerContainer#0-1] WARN 
com.atomikos.jms.AbstractJmsProxy  - Error delegating 'createSession' call
to JMS driver 
javax.jms.InvalidClientIDException: Broker: localhost - Client: msgListener
already connected from tcp://

I seem to be caught in a catch-22 type problem here... Anyone had success
with this kind of config?

Thanks for your help,

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message