activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elvis Stansvik <>
Subject Composite destinations in old style ActiveMQ Spring configuration
Date Thu, 04 Jul 2013 16:29:41 GMT
Hi everyone,

I've recently been tasked with writing an application that should receive
messages from an existing Spring application (a game server) that uses
ActiveMQ. The game server currently sends messages on a queue called
${jms.queue.audit}, from which another application (called the "auditor")

What I need to do is configure a new queue, parallell to the
${jms.queue.audit} queue, from which my new application can receive. The
new application should receive exactly the same messages as the auditor.

Since I'm new to both Spring, JMS and ActiveMQ, I first felt a bit lost.
But I understand that what I need to is probably to configure a composite
destination [1], let's call it ${jms.queue.game_events}, which fans out
into two separate queues ${jms.queue.audit} and ${jms.queue.new_queue}.
E.g. like this:

${jms.queue.game_events} ----> ${jms.queue.new_queue}

I'd then reconfigure the game server to send messages on the virtual queue
${jms.queue.game_events}, and they would be delivered both to my new
application and to the auditor.

Looking at the relevant section of the Spring XML configuration for the
game server, it looks like:

<!-- JMS Configuration -->

<bean id="jmsFailoverConnectionFactory"
<property name="brokerURL" value="failover:tcp://${}:${jms.port}"/>
<property name="copyMessageOnSend" value="false"/>

<bean id="jmsConnectionFactory"
<property name="brokerURL" value="tcp://${}:${jms.port}"/>
<property name="copyMessageOnSend" value="false"/>

<!-- JVM Dispatch Bridge Broker -->

<bean id="jvmBroker" class=""
init-method="start" destroy-method="stop">
<property name="persistent" value="true"/>
<property name="dataDirectory" value="${}"/>
<property name="transportConnectorURIs">
<property name="useJmx" value="false"/>
<property name="jmsBridgeConnectors">
<bean class="">
<property name="outboundQueueConnectionFactory"
<property name="outboundQueueBridges">
<!-- audit -->
<bean class="">
<constructor-arg value="${jms.queue.audit}"/>
<!-- generic history -->
<bean class="">
<constructor-arg value="${jms.queue.generichistory}"/>

<bean id="jvmConnectionFactory"
<property name="brokerURL" value="vm://localhost"/>
<property name="copyMessageOnSend" value="false"/>

<!-- Audit Factory -->

<bean id="auditFactory"
<constructor-arg index="0">
<bean class="com.straycatstudios.wsc.common.spring.messaging.JmsSender">
<bean class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jvmConnectionFactory"/>
<property name="defaultDestinationName" value="${jms.queue.audit}"/>
<property name="messageConverter">
<constructor-arg index="0" ref="simpleMessageConverter"/>

So it looks like it is using standard beans to set up the BrokerService and
other ActiveMQ stuff, instead of using the new style of embedding ActiveMQ
XML configuration inside the Spring XML. The JmsAuditFactory is the class
that does the sending, taking a JmsSender as constructor argument.

So finally, my question is: How I would go about setting up this composite
destination with a minimal amount of modifications to the Spring XML
configuration? The

The example at [1] only shows how to do it with the new approach of Spring
configuration, but I'd rather not do invasive things such as converting the
whole thing to the new embedded style, as I'm afraid I'd screw things up.

Very grateful for any tips/pointers on how to proceed. The full Spring
configuration of the game server is at ,
in case the above paste is not enough (or mangled).

Best regards,
Elvis Stansvik


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message