blob: 425e740f70444ca808ea3e03c76393659b7fea0b [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">
<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
&lt;beans&gt;
&lt;!-- Allows us to use system properties as variables in this configuration file --&gt;
&lt;bean class=&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;/&gt;
&lt;broker useJmx=&quot;true&quot; persistent=&quot;false&quot; xmlns=&quot;http://activemq.org/config/1.0&quot;
brokerName=&quot;localhost&quot; dataDirectory=&quot;${activemq.base}/data&quot;&gt;
&lt;jmsBridgeConnectors&gt;
&lt;jmsQueueConnector outboundQueueConnectionFactory=&quot;#localBroker&quot;&gt;
&lt;inboundQueueBridges&gt;
&lt;inboundQueueBridge
inboundQueueName = &quot;queue.ping&quot;
localQueueName = &quot;queue.incomingMsgs.ping&quot;
selector = &quot;JMSType LIKE &#39;foo%&#39;&quot;/&gt;
&lt;/inboundQueueBridges&gt;
&lt;outboundQueueBridges&gt;
&lt;outboundQueueBridge
localQueueName = &quot;queue.incomingMsgs.ping&quot;
outboundQueueName = &quot;queue.pong&quot;
selector = &quot;JMSType LIKE &#39;foo%&#39;&quot;/&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=&quot;localBroker&quot; class=&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;&gt;
&lt;property name=&quot;brokerURL&quot; value=&quot;vm://localhost:61616&quot; /&gt;
&lt;/bean&gt;
&lt;/beans&gt;
]]></script>
</div></div></div>