activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Purcell <tpurc...@chariotsolutions.com>
Subject Re: [heads up] example of configuring the JMS bridge using the XBean XML
Date Wed, 19 Jul 2006 16:11:52 GMT

Well,

That is not entirely correct. If you are working with a foreign provider
which, like activemq, has a ConnectionFactory object that exposes a setter
for the connection properties like host and port (setBrokerUrl) this will
work. If, however, you are attempting to bridge to a foreign provider which
does not, weblogic for instance, it will not.  However, you can still
connect.

The activemq class that does the work is JmsQueueConnector. The method that
does the work, initializeForeignQueue, first checks to see if there is an
existing QueueConnection. If not it looks to see if
outboundQueueConnectionFactory is set. (In the weblogic case it does no good
to set this because, as stated, the weblogic JMS does not have an
appropriate setter.) If that is not set it checks for
outboundQueueConnectionFactoryName if that is set it does a lookup using the
jndiOutboundTemplate and the connection is made.

So what you need is to set outboundQueueConnectionFactoryName and
jndiOutboundTemplate in your activemq.xml config file. See the sample below:

Thanks
Tom


<!-- START SNIPPET: example -->
<beans>

  <!-- Allows us to use system properties as variables in this configuration
file -->
  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
  <broker useJmx="true" xmlns="http://activemq.org/config/1.0">
  
    <persistenceAdapter>
        <journaledJDBC journalLogFiles="5"
dataDirectory="${activemq.home}/activemq-data"/>
    </persistenceAdapter>
  
    <transportConnectors>
       <transportConnector name="default" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>
    
    <networkConnectors>
      <networkConnector name="default" uri="multicast://default"/>
    </networkConnectors>
    
    <jmsBridgeConnectors>
     <jmsQueueConnector name="JreportRequestBridge-Inbound"
        jndiOutboundTemplate="#remoteJndi"
        outboundQueueConnectionFactoryName="jms/ssi/ConnectionFactory"
        localQueueConnectionFactory="#localFactory">
        <inboundQueueBridges>
          <inboundQueueBridge inboundQueueName="jms/queue/jreport/request"/>
        </inboundQueueBridges>
      </jmsQueueConnector>
    </jmsBridgeConnectors>

  </broker>

    <!-- Set up the template for connecting to Weblogic -->
    <bean id="remoteJndi" class="org.springframework.jndi.JndiTemplate">
	<property name="environment">
		<props>
			<prop
key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
			<prop key="java.naming.provider.url">t3://00.00.00.00:7001</prop>
		</props>
	</property>
    </bean>

  <bean id="localFactory"
    class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
  </bean>
 
  <bean id="localQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value="dynamic/jms.queue.jreport.request"/>
  </bean> 
</beans>
<!-- END SNIPPET: xbean -->

-- 
View this message in context: http://www.nabble.com/-heads-up--example-of-configuring-the-JMS-bridge-using-the-XBean-XML-format-tf1891213.html#a5399361
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message