I am using camel 2.5.0 and activemq 5.4.0 to create a simple route of the
form dataset -> activemq:queue.in -> activemq:queue.out -> dataset.
All are working fine and I the performance is more than 1K messages/sec.

However if I set transactions=true on the activemq component configuration,
then I experience serious performance issues (5 messages/sec).

I am testing using camel:run maven plugin. My configuration is the
following:

<beans
        xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:amq="http://activemq.apache.org/schema/core";
        xmlns:camel="http://camel.apache.org/schema/spring";
        xmlns:context="http://www.springframework.org/schema/context";
        xmlns:aop="http://www.springframework.org/schema/aop";
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core.xsd
        http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
        http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>

    <!-- Allows us to use system properties as variables in this
configuration file -->
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

    <!-- ActiveMQ Broker -->
    <broker id="broker" xmlns="http://activemq.apache.org/schema/core";
brokerName="localhost" dataDirectory="data"
            useJmx="true" persistent="true" advisorySupport="false">
        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">" producerFlowControl="false"
optimizedDispatch="true">
                        <pendingQueuePolicy>
                            <vmQueueCursor/>
                        </pendingQueuePolicy>
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>

        <persistenceAdapter>
            <kahaDB directory="data/kahadb" enableIndexWriteAsync="true"/>
        </persistenceAdapter>

        <transportConnectors>
            <transportConnector name="nio" uri="nio://0.0.0.0:61616"/>
        </transportConnectors>
    </broker>

    <!-- Camel Context -->
    <camelContext xmlns="http://camel.apache.org/schema/spring";
id="messaging" depends-on="broker">
        <route>
            <from uri="dataset:loadtest?produceDelay=-1"/>
            <to uri="activemq:queue:queue.in"/>
        </route>
    </camelContext>

    <!-- Camel Components -->
    <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="connectionFactory" ref="pooledConnectionFactory"/>
        <!--property name="transacted" value="true"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transactionTimeout" value="300000"/-->
        <property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE"/>
        <property name="cacheLevelName" value="CACHE_AUTO"/>
    </bean>


    <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="nio://127.0.0.1:61616"/>
        <property name="useAsyncSend" value="true"/>
    </bean>

    <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="maxConnections" value="1"/>
        <property name="maximumActive" value="500"/>
    </bean>

    <!-- DataSet -->
    <bean id="loadtest"
class="org.apache.camel.component.dataset.SimpleDataSet">
        <property name="size" value="100000"/>
    </bean>

    <!-- Transaction Manager -->
    <bean id="transactionManager"
class="org.jencks.factory.TransactionManagerFactoryBean"/>
</beans>


-- 
*Ioannis Canellos*
http://iocanel.blogspot.com
Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>

Reply via email to