Hi,

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"
class="org.apache.activemq.pool.PooledConnectionFactory">
    <property name="connectionFactory">
      <bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:6666" />
      </bean>
    </property>
  </bean>

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

  <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring";>
    <route>
      <from uri="jms:queueInput" />
      <to uri="bean:testBean" />
    </route>
  </camelContext>

  <bean id="testBean" class="com.xtradesoft.tg.olt.messaging.camel.TestBean"
/>

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"
class="org.springframework.jms.listener.serversession.CommonsPoolServerSessionFactory"/>

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

I hope now the Problem is clearer.

kind regards

oliver

-- 
View this message in context: 
http://www.nabble.com/Camel-keeps-adding-and-removing-Consumers-when-using-DefaultMessageListenerContainer-tf4778316s22882.html#a13722674
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to