You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Michal Singer <mi...@leadspace.com> on 2012/11/15 06:10:29 UTC
jms template is slow and stucks
Hi,
I am running a simple point-to-point example and trying to run 80000
requests from a client to a server.
When I run it as is – it goes fast and finishes.
When I changed the server to support spring and use jmstemplate to send the
message, the reply is slower and gets stuck eventually.
Any ideas why is this? Is there a known issue on this?
This is the configuration I am using for spring:
<!-- Consumer -->
<bean id=*"serverListener"* class=*"example.Server"*>
<property name=*"jmsTemplate"* ref=*"jmsTemplate"*/>
</bean>
<bean id=*"containerServer"*
class=*
"org.springframework.jms.listener.DefaultMessageListenerContainer"*>
<property name=*"concurrentConsumers"* value=*"20"*/><!--
change to 20 -->
<property name=*"maxConcurrentConsumers"* value=*"50"*/>
<property name=*"idleTaskExecutionLimit"* value=*"10"*/>
<property name=*"maxMessagesPerTask"* value=*"30"*/>
<property name=*"connectionFactory"* ref=*"jmsConnectionFactory"
* />
<property name=*"destination"* ref=*"agentProcessQueue"* />
<property name=*"messageListener"* ref=*"serverListener"* />
</bean>
<bean id=*"agentProcessQueue"* class=*
"org.apache.activemq.command.ActiveMQQueue"*>
<constructor-arg value=*"agentProcessQueue"*/>
</bean>
<bean id=*"jmsConnectionFactory"*
class=*"org.apache.activemq.ActiveMQConnectionFactory"*>
<property name=*"brokerURL"* value=*"tcp://localhost:61616"* />
</bean>
<!-- Producer -->
<!-- for send response on *temp* q-->
<bean id=*"jmsTemplate"* class=*
"org.springframework.jms.core.JmsTemplate"* lazy-init=*"true"*>
<property name=*"connectionFactory"* ref=*"jmsConnectionFactory"*/>
</bean>
Thanks
Re: jms template is slow and stucks
Posted by Stan Lewis <st...@redhat.com>.
tl;dr use a pooled connection factory, more detail look at this page -> http://activemq.apache.org/jmstemplate-gotchas.html
----- Original Message -----
From: "Michal Singer" <mi...@leadspace.com>
To: users@activemq.apache.org
Sent: Thursday, November 15, 2012 12:10:29 AM
Subject: jms template is slow and stucks
Hi,
I am running a simple point-to-point example and trying to run 80000
requests from a client to a server.
When I run it as is – it goes fast and finishes.
When I changed the server to support spring and use jmstemplate to send the
message, the reply is slower and gets stuck eventually.
Any ideas why is this? Is there a known issue on this?
This is the configuration I am using for spring:
<!-- Consumer -->
<bean id=*"serverListener"* class=*"example.Server"*>
<property name=*"jmsTemplate"* ref=*"jmsTemplate"*/>
</bean>
<bean id=*"containerServer"*
class=*
"org.springframework.jms.listener.DefaultMessageListenerContainer"*>
<property name=*"concurrentConsumers"* value=*"20"*/><!--
change to 20 -->
<property name=*"maxConcurrentConsumers"* value=*"50"*/>
<property name=*"idleTaskExecutionLimit"* value=*"10"*/>
<property name=*"maxMessagesPerTask"* value=*"30"*/>
<property name=*"connectionFactory"* ref=*"jmsConnectionFactory"
* />
<property name=*"destination"* ref=*"agentProcessQueue"* />
<property name=*"messageListener"* ref=*"serverListener"* />
</bean>
<bean id=*"agentProcessQueue"* class=*
"org.apache.activemq.command.ActiveMQQueue"*>
<constructor-arg value=*"agentProcessQueue"*/>
</bean>
<bean id=*"jmsConnectionFactory"*
class=*"org.apache.activemq.ActiveMQConnectionFactory"*>
<property name=*"brokerURL"* value=*"tcp://localhost:61616"* />
</bean>
<!-- Producer -->
<!-- for send response on *temp* q-->
<bean id=*"jmsTemplate"* class=*
"org.springframework.jms.core.JmsTemplate"* lazy-init=*"true"*>
<property name=*"connectionFactory"* ref=*"jmsConnectionFactory"*/>
</bean>
Thanks