Friday, January 18, 2008

spring jms quickstart infrastructure configuration

using spring JMS and ApacheMQ you can set up messaging capabilities within your application, even outside of a jee container.

here is an xml sample representing the beans that set up the jms infrastructure:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://embedded?broker.persistent=false"/>

<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.request"></constructor-arg>

<bean id="confirmationQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="queue.confirmation"></constructor-arg>


the latter beans are queues, which can be named and coded appropriately and you can have as many as you need. queues are required for messages to be sent on.

the broker url also needs adjusting to represent your infrastructure, however this embedded broker can be used for development and testing.


Post a Comment

Links to this post:

Create a Link

<< Home