Without connection pooling, JMSTemplate, by default, creates a new connection, session, producer for each message sent and then closes them all again. This results in a long workaround time and you get get reconnected on every JMS message sent.
Sample configuration of JMS with ActiveMQ Connection Pooling
<bean id="connectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>tcp://broker1:61616< /value>
</property>
</bean>
</property>
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" >
< property name="connectionFactory" ref="connectionFactory"/>
</bean>