I can't post my entire test, i don't see where i can attach files.
I am testing this flow:
1.Client->send request ->Server.
2. Server->send response->Client.
3. Client->receive response&send message to some measurement client
4. Measurement Client->receive message - after receiving all messages it will stop the timer.
This full flow is tested for 300k messages.
and it takes for Activemq with no spring half the time as it does for with spring.
Here is the spring xml i am using.
Code:
<!-- ********************** Consumer ********************************* -->
<bean id="clientListener" class="example.ClientReceive">
<property name="receiveQueue" ref="receiveQueue" />
<property name="sinkQueue" ref="sinkQueue" />
<property name="clientSender" ref="clientSender"/>
</bean>
<bean id="containerClient"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="concurrentConsumers" value="20"/><!-- if it is not 1 - it is difficult to see distribution to other services!!!change to 50,20 -->
<property name="maxConcurrentConsumers" value="50"/><!-- if it is not 1 - it is difficult to see distribution to other services!!!change to 50-->
<property name="idleTaskExecutionLimit" value="10"/>
<!-- <property name="maxMessagesPerTask" value="30"/> -->
<property name="connectionFactory" ref="singleConnectionFactory" />
<property name="destination" ref="receiveQueue" />
<property name="messageListener" ref="clientListener" />
<property name="sessionAcknowledgeMode" value="1"/>
</bean>
<bean id="receiveQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queueA"/>
</bean>
<bean id="sinkQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="sinkQueue"/>
</bean>
<!-- ********************** END-Consumer ***************************** -->
<!-- ********************** Producer ********************************* -->
<bean id="clientSender" class="example.ClientSend">
<property name="sendQueue" ref="sendQueue" />
<property name="jmsTemplate" ref="jmsTemplate"/>
</bean>
<bean id="sendQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queueB"/>
</bean>
<!-- for send response on temp q-->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" lazy-init="true">
<property name="connectionFactory" ref="cachingConnectionFactory"/>
</bean>
<!-- ********************** END Producer ********************************* -->
<!-- ********************** Common ********************************* -->
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="failover:(tcp://localhost:61616)?randomize=false" /> <!-- Single broker-->
<!-- <property name="brokerURL" value="tcp://localhost:61616" /> -->
<!-- <property name="brokerURL" value="failover:(tcp://localhost:61616?wireFormat.tightEncodingEnabled=false)?randomize=false" /> --><!-- for vertical scalability-->
<!-- <property name="brokerURL" value="failover:(tcp://localhost:61616,tcp://dev15:61616)?randomize=true"/> --> <!-- network of brokers -->
<!-- <property name="brokerURL" value="failover:(tcp://dev15:61616)?randomize=true"/> -->
<!-- <property name="brokerURL" value="vm://amq3?brokerConfig=xbean:amq3.xml" /> --><!-- embedded broker for network of brokers -->
<!-- <property name="brokerURL" value="failover:(tcp://0.0.0.0:61618,tcp://0.0.0.0:61617)" /> --><!-- service broker for network of brokers : connect to amq3-->
<!-- <property name="brokerURL" value="failover:(tcp://0.0.0.0:61618)" /> --> <!-- connection amq3 -->
</bean>
<bean id="singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory"
ref="connectionFactory" />
<property name="reconnectOnException" value="true"/>
</bean>
<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
<constructor-arg ref="connectionFactory"/>
<property name="maxConnections" value="10" />
</bean>
<bean id="cachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<constructor-arg ref="singleConnectionFactory"/>
<property name="sessionCacheSize" value="100" />
</bean>
<!-- <bean id="sinkQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="sinkQueue"/>
</bean> -->
</beans>
I am not sure what you mean by "comparing apples and oranges"... i am testing the same code, once with spring and once with
creating my own activemq objects and using