WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: BTM Spring ActiveMQ number of consumers keeps increasing

BTM Spring ActiveMQ number of consumers keeps increasing

by James Black :: Rate this Message:

| View in Thread

Hello,

we are currently testing BTM and our having some issues.

Basically the number of consumers on the ActiveMQ queue keeps going up and up each second.

Our concurrency is set to 5-10 for our DefaultMessageListener.

What we are using:

Spring 3.0.5
Hibernate 3.6.2
ActiveMQ 5.5.0
BTM 2.1.0

I have configured everything as per the BTM docs.

<bean id="txManager"
          class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager" ref="btmTransactionManager" />
        <property name="userTransaction" ref="btmTransactionManager" />
    </bean>

    <bean id="btmConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices">
         <property name="serverId" value="spring-api-btm" />
    </bean>

    <bean id="btmTransactionManager" factory-method="getTransactionManager"
          class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig" destroy-method="shutdown" />

    <bean id="entityManagerFactory"
          depends-on="btmConfig"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="platformEntityManager" />
        <property name="dataSource" ref="dataSource" />
    </bean>

I left out the data source config but it is the correct PoolingDataSource, now the JMS stuff.

<bean id="btmConnectionFactory"
          class="bitronix.tm.resource.jms.PoolingConnectionFactory"
          init-method="init" destroy-method="close">
         
        <property name="className" value="org.apache.activemq.ActiveMQXAConnectionFactory" />
        <property name="uniqueName" value="XAJMS" />
        <property name="minPoolSize" value="40" />
        <property name="maxPoolSize" value="40" />
        <property name="driverProperties">
            <props>
                <prop key="brokerURL">tcp://localhost:61616</prop>
            </props>
        </property>
    </bean>

<bean id="MessageListenerAdapter1"  -->
           class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
        <property name="delegate" ref="targetEntity" />
         <property name="defaultListenerMethod" value="doStuff" />
         <property name="messageConverter" ref="MyMessageConverter" />
     </bean>

    <bean id="MessageListenerContainer1"
          class="org.springframework.jms.listener.DefaultMessageListenerContainer"
          depends-on="txManager">
        <property name="connectionFactory" ref="btmConnectionFactory"/>
        <property name="destination" ref="jmsQueue1"/>
        <property name="messageListener" ref="MessageListenerAdapter1" />
        <property name="concurrency" value="5-10" />
        <property name="transactionManager" ref="txManager" />
        <property name="sessionTransacted" value="true" />
        <property name="clientId" value="LIST1" />
    </bean>

Any help much appreciated, if you fix it I will send you beer tokens through Paypal :>

James

 « Return to Thread: BTM Spring ActiveMQ number of consumers keeps increasing