You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Marcin Cylke <mc...@touk.pl> on 2010/03/17 12:24:46 UTC

Multiple durable consumers on jms topic

Hi

I'm having some weird behavior with JMS one-producer-multiple-consumer
situation.

I'm publishing messages to jms topic and than have multiple consumers which
poll messages from it. Each consumer is in separate SU and I'm deploying all
the components in SMX (3.3). 

The problem I'm observing is that when only one consumer is deployed, all
works fine, no matter which consumer it is. However if I deploy more than
one, only the first works, while the rest does not recive messages from the
topic.

What I see in the thread dump is:

"DefaultMessageListenerContainer-1" prio=10 tid=0x60565000 nid=0x5008
waiting on condition [0x5e283000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer.sleepInbetweenRecoveryAttempts(DefaultMessageListenerContainer.java:837)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:807)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:767)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:898)
	- locked <0x75d22278> (a java.lang.Object)
	at java.lang.Thread.run(Thread.java:619)

and this looks strange.

I've configured my camel jms endpoint like this:

<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
        <property name="connectionFactory" ref="jmsConnectionFactory"/>
        <property name="concurrentConsumers"
value="${activations-NetiaEvent.concurrentConsumers}"/>
    </bean>
    
    <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
        <property name="configuration" ref="jmsConfig"/>
    </bean>
    
    <bean id="jmsConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName" value="java:/jms/connectionFactory" />
    </bean>

Since I'm deploying all the consumers on the same SMX, I have separate jms
connectionFactories for them, however don't know if it is necessary.

I'm using camel 1.4.0, and unfortunatelly am unable to upgrade.

Thanks in advance for any help.

Regards Marcin
-- 
View this message in context: http://old.nabble.com/Multiple-durable-consumers-on-jms-topic-tp27930623p27930623.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple durable consumers on jms topic

Posted by Marcin Cylke <mc...@touk.pl>.
Replying to myself. Seems like the problem does not exist if I use external
Activemq broker. 

Nevertheless it would be nice to have it working with the embedded one.

Regards
Marcin
-- 
View this message in context: http://old.nabble.com/Multiple-durable-consumers-on-jms-topic-tp27930623p27942604.html
Sent from the Camel - Users mailing list archive at Nabble.com.