camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oliT <>
Subject Re: Camel keeps adding and removing Consumers when using DefaultMessageListenerContainer
Date Tue, 13 Nov 2007 09:50:59 GMT


James.Strachan wrote:
> Hmm - I still don't quite understand what your application is actually
> doing - e.g. I don't know what the Routes stuff does or the TestBean
> etc.

Ok, i created an example without any custom stuff to make the issue clearer:

  <bean id="jmsFactory"
    <property name="connectionFactory">
      <bean id="jmsConnectionFactory"
        <property name="brokerURL" value="tcp://localhost:6666" />

  <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsFactory" />

  <camelContext id="camel"
      <from uri="jms:queueInput" />
      <to uri="bean:testBean" />

  <bean id="testBean" class=""

The purpose of this route is simple. All messages arriving at the queueInput
shall be received and processed by the bean "testBean". 
If i launch this, it creates a DefaultMessageListenerContainer and polls for
Messages. So each second a new thread try's to receive. I dont want every
module to create and delete a consumer with the broker each second. So i
tried to use the ServerSessionMessageListenerContainer by adding the
following properties to the JmsComponent:
 <property name="serverSessionFactory" ref="serverSessionFactory" />
 <property name="consumerType" value="ServerSessionPool" />

and defining the ServerSessionFactory:
 <bean id="serverSessionFactory"

but this wont work. Is there any way to get a better behaivior?

I hope now the Problem is clearer.

kind regards


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message