5.4. Using JMS Message Destinations

For integration with JMS, a special JmsAdapter is provided that internally makes use of Spring's JmsTemplate, DestinationResolver, DefaultMessageListenerContainer and other such JMS abstractions for simplified interaction with JMS resources. The jms-message-destination XML namespace tag is used to expose JMS destinations as BlazeDS message destinations. The minimal attributes that must be specified are the destination id and exactly one of jms-destination, queue-name, or topic-name. A JMS ConnectionFactory reference is also required, but does not have to be explicitly specified if there is already one configured in the current application context with an id of "connectionFactory". For example, to configure a BlazeDS message destination named "chatIn" that uses a Spring-managed ActiveMQ JMS queue with a local ActiveMQ installation:

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
	<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
	
<bean id="chatInQueue" class="org.apache.activemq.command.ActiveMQQueue">
	<constructor-arg value="queue.flex.chat.in"/>
</bean>

<flex:jms-message-destination id="chatIn" jms-destination="chatInQueue" />    	
    	

Using queue-name or topic-name will cause the destination to be resolved using a Spring DestinationResolver. The destination-resolver, message-converter, and transaction-manager attributes may be used to set custom references to a Spring-managed DestinationResolver, MessageConverter, or TransactionManager respectively.