Atomikos Forum

Performance problem

Hi;

The scenario is this:

Spring 2.5.5
ActiveMQ 5.1
Hibernate 3.3.1
DB2 9.5
Atomikos 3.4

Use case: POJO messages are consumed by Spring’s DefaultMessageListenerContainer, some JPA Hibernate queries are issued, simple transformations are executed and the result is written to the database.

After adding global XA transaction management with Atomikos, the performance has gone down through the floor, i.e. less than a single message pr. second is retrieved from the queue.  A quick execution profiling tells us that for every JMS message a new connection is created.  The relevant Spring configurations are as following:

(continued)
Helgi Viggosson Send private email
Tuesday, November 04, 2008
 
 
<bean id="xaFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory">
    <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
</bean>

<bean id="RealConnectionFactory" class="com.atomikos.jms.QueueConnectionFactoryBean"
    init-method="init">
    <property name="resourceName" value="AMRamq1" />
    <property name="xaQueueConnectionFactory" ref="xaFactory" />
</bean>

<bean id="ConnectionFactory"
    class="org.springframework.jms.connection.SingleConnectionFactory">
    <property name="targetConnectionFactory" ref="RealConnectionFactory" />
</bean>

<bean id="AtomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
    init-method="init" destroy-method="close">
    <property name="forceShutdown" value="false" />
</bean>

<bean id="AtomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
        <property name="transactionTimeout" value="300" />
</bean>

<bean id="transactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManager" ref="AtomikosTransactionManager" />
    <property name="userTransaction" ref="AtomikosUserTransaction" />
</bean>
<bean id="msgHandler" class="is.cofus.amr.jms.testing.DataMartWriter">
    <property name="fail" value="false" />
    <property name="cmpgnServices">
        <ref bean="cmpgnServices" />
    </property>
    <property name="cimartServices">
        <ref bean="cimartServices" />
    </property>
</bean>

<bean id="msgListener"
    class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
    <property name="delegate" ref="msgHandler" />
    <property name="defaultListenerMethod" value="receivePosTrx" />
</bean>

<bean id="trxAttributes"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="transactionAttributes">
        <props>
            <prop key="*">PROPAGATION_REQUIRED, -Exception</prop>
        </props>
    </property>
    <property name="target" ref="msgHandler" />
</bean>
<jms:listener-container transaction-manager="transactionManager"
    connection-factory="ConnectionFactory" acknowledge="transacted">
    <jms:listener destination="${outboundQueueName}" ref="msgListener" />
</jms:listener-container>

<bean id="MessageListenerContainer"
    class="org.springframework.jms.listener.DefaultMessageListenerContainer"
    destroy-method="close">
    <property name="concurrentConsumers" value="1" />
    <property name="connectionFactory" ref="ConnectionFactory" />
    <property name="destination" ref="appJmsDestination" />
    <property name="messageListener" ref="msgListener" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="sessionTransacted" value="true" />
    <property name="receiveTimeout" value="5000" />
    <property name="recoveryInterval" value="6000" />
    <property name="autoStartup" value="false" />
</bean>
----------

I appreciate any suggestion on how to improve this.

Best regards,
Helgi Viggosson
Helgi Viggosson Send private email
Tuesday, November 04, 2008
 
 
Hi,

Try using the new AtomikosConnectionFactoryBean instead of the old QueueConnectionFactoryBean - the new one has pooling.

Guy
Guy Pardon Send private email
Tuesday, November 04, 2008
 
 
Guy, thanks for your quick response.  Now I've changed the definition for the JMS connection to this:

    <bean id="RealConnectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean"
        init-method="init">
        <property name="uniqueResourceName" value="AMRamq1"/>
        <property name="xaConnectionFactory" value="xaFactory"/>
    </bean>

And, now it sits stuck after printing this to the console:

No properties path set - looking for transactions.properties in classpath...
transactions.properties not found - looking for jta.properties in classpath...
Using init file: /F:/Cofus/ws3/JMStesting/bin/jta.properties

--

What are we missing?

Regards,
Helgi Örn Viggósson.
Helgi Viggosson Send private email
Wednesday, November 05, 2008
 
 
This is an ActiveMQ issue with the new JMS pools.

Dropping the init from the AtomikosConnectionFactoryBean should do the trick.

HTH
Guy Pardon Send private email
Thursday, November 27, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics