blob: e0c9203871c8f639d65f3f1fe40821c9a05d45c2 [file] [log] [blame]
<div class="wiki-content maincontent"><h3 id="JMSBridgeWithLocalBroker-ExampleofaconfigurationthatshowshowtouseaBridgeConnectortomakeaconnectiontothelocalActiveMQbroker.">Example of a configuration that shows how to use a BridgeConnector to make a connection to the local ActiveMQ broker.</h3>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
&lt;beans&gt;
&lt;!-- Allows us to use system properties as variables in this configuration file --&gt;
&lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
&lt;broker useJmx="true" persistent="false" xmlns="http://activemq.org/config/1.0"
brokerName="localhost" dataDirectory="${activemq.base}/data"&gt;
&lt;jmsBridgeConnectors&gt;
&lt;jmsQueueConnector outboundQueueConnectionFactory="#localBroker"&gt;
&lt;inboundQueueBridges&gt;
&lt;inboundQueueBridge
inboundQueueName = "queue.ping"
localQueueName = "queue.incomingMsgs.ping"
selector = "JMSType LIKE 'foo%'"/&gt;
&lt;/inboundQueueBridges&gt;
&lt;outboundQueueBridges&gt;
&lt;outboundQueueBridge
localQueueName = "queue.incomingMsgs.ping"
outboundQueueName = "queue.pong"
selector = "JMSType LIKE 'foo%'"/&gt;
&lt;/outboundQueueBridges&gt;
&lt;/jmsQueueConnector&gt;
&lt;/jmsBridgeConnectors&gt;
&lt;/broker&gt;
&lt;!-- JMS ConnectionFactory to use for local bridging --&gt;
&lt;bean id="localBroker" class="org.apache.activemq.ActiveMQConnectionFactory"&gt;
&lt;property name="brokerURL" value="vm://localhost:61616" /&gt;
&lt;/bean&gt;
&lt;/beans&gt;
</pre>
</div></div></div>