I suspect you aren't caching the connection/sessions. Try wrapping the connectionfactory with a org.springframework.jms.connection.SingleConnectionFactory or org.springframework.jms.connection.CachingConnectionFactory. In your direct case, you have a persisted connections, and most likely a single session. The default behavior of Spring-JMS, which is what Camel is using, is to let the connectionfactory worry about the caching by asking it each time for a fresh instance (e.g. through the SingleConnectionFactory or CachingConnectionFactory wrappers).
-----Original Message----- From: RadoslavStoyanov [mailto:radoslav.stoya...@softwareag.com] Sent: Monday, December 05, 2011 11:45 AM To: users@camel.apache.org Subject: Performance issue with Camel JMS publish/subscribe Hi, I experience the next problem: Created two Endpoints pointing to same JMS topic. The JMS provider is WmBroker. Used Spring xml descriptor to define the Camel context. The first endpoint is used for publishing, the second for subscribing. I instantiated two of our pub/sub API classes to test the performance - one using directly our wmBroker api, and another one using Camel for pub/sub. The test is: There is registered one subscriber listener. In another thread there are sent 10000 messages. Ther start time is registered. When the last message is received the listener register the end time. Then the sent messages are devided by the passed time and the result is the passed through messages per second. The disturbing thing is that the custom API using the same connection factory shows 10:1 better performance in same conditions as Camel. Do you have any ide why Camel shows so big performance drawback? This is the used camel context, if it is neded I could provide also the test java code used for the performance test. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" createConnector="true" /> <endpoint id="inboundSMS" uri="jms:topic:Event::WebM::Communication::Sms::SmsSent" /> <endpoint id="outboundSMS" uri="jms:topic:Event::WebM::Communication::Sms::SmsSent" /> </camelContext> <bean id="jms" class="org.apache.camel.component.jms.JmsComponent"> <property name="connectionFactory"> <bean class="com.webmethods.jms.impl.WmConnectionFactoryImpl"> <property name="BrokerHost" value="localhost:6849" /> <property name="BrokerName" value="Broker #1" /> <property name="ClientGroup" value="StressGroup" /> </bean> </property> </bean> <bean id="etStoreConfig" class="com.softwareag.eda.configuration.beans.FileEventTypeStoreConfigType"> <property name="location" value="E:/SoftwareAG/common/EventTypeStore" /> </bean> <bean id="edaEventTypeStore" class="com.softwareag.eda.store.api.EventTypeStoreFactory" factory-method="createEventTypeStore" depends-on="etStoreConfig"> <constructor-arg name="configuration" ref="etStoreConfig" type="com.softwareag.eda.configuration.beans.EventTypeStoreConfigType"/> </bean> <bean id="camelConnector" class="org.apache.camel.example.spring.CamelConnector"> <property name="context" ref="camel" /> </bean> <bean id="eventTypeID" class="com.softwareag.eda.store.api.EDAEventTypeID"> <constructor-arg name="namespace" value="http://namespaces.softwareag.com/EDA/WebM/Communication/Sms"/> <constructor-arg name="name" value="SmsSent"/> </bean> <bean id="edaOrchestratorCamel" class="com.softwareag.eda.orchestrator.impl.EDAOrchestratorImpl" depends-on="camelConnector, edaEventTypeStore"> <constructor-arg name="connector" ref="camelConnector" type="com.softwareag.eda.connector.EventBusConnector"/> <constructor-arg name="eventTypeStore" ref="edaEventTypeStore" type="com.softwareag.eda.store.api.EDAEventTypeStore"/> </bean> <bean id="streamConfiguration" class="java.io.FileInputStream" > <constructor-arg value="C:/edaconfig/edaConfig.xml" type="java.lang.String"/> </bean> <bean id="edaOrchestratorCustom" class="com.softwareag.eda.orchestrator.api.EDAOrchestratorFactory" factory-method="createOrchestrator" depends-on="streamConfiguration"> <constructor-arg ref="streamConfiguration" type="java.io.InputStream"/> </bean> <bean id="testClient" class="org.apache.camel.example.spring.TestClient" init-method="init" depends-on="edaOrchestratorCamel, edaOrchestratorCustom"> <property name="orchestratorCamel" ref="edaOrchestratorCamel" /> <property name="orchestratorCustom" ref="edaOrchestratorCustom" /> <property name="edaEventTypeID" ref="eventTypeID" /> </bean> </beans> -- View this message in context: http://camel.465427.n5.nabble.com/Performance-issue-with-Camel-JMS-publish-subscribe-tp5049909p5049909.html Sent from the Camel - Users mailing list archive at Nabble.com.