You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Dan Hayes <dh...@chariotsolutions.com> on 2006/07/13 21:12:07 UTC

Re: [heads up] example of configuring the JMS bridge using the XBean XML

James,

How would the configuration file look if one end of the bridge was a
non-ActiveMQ endpoint, such as a Weblogic JMS queue?

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


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by Tom Purcell <tp...@chariotsolutions.com>.
James

That would be great.

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


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by Tom Purcell <tp...@chariotsolutions.com>.
Thanks
-- 
View this message in context: http://www.nabble.com/-heads-up--example-of-configuring-the-JMS-bridge-using-the-XBean-XML-format-tf1891213.html#a5435907
Sent from the ActiveMQ - User forum at Nabble.com.


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by James Strachan <ja...@gmail.com>.
Great - thanks, it looks great!

http://activemq.org/site/jms-to-jms-bridge.html


On 7/21/06, Tom Purcell <tp...@chariotsolutions.com> wrote:
>
> Done. Thanks James.
> --
> View this message in context: http://www.nabble.com/-heads-up--example-of-configuring-the-JMS-bridge-using-the-XBean-XML-format-tf1891213.html#a5433475
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by Tom Purcell <tp...@chariotsolutions.com>.
Done. Thanks James.
-- 
View this message in context: http://www.nabble.com/-heads-up--example-of-configuring-the-JMS-bridge-using-the-XBean-XML-format-tf1891213.html#a5433475
Sent from the ActiveMQ - User forum at Nabble.com.


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by James Strachan <ja...@gmail.com>.
On 7/20/06, Tom Purcell <tp...@chariotsolutions.com> wrote:
>
> James
>
> I just realized it seems I can edit the page. Do you want me to do it?

That'd be even better - thanks! :)

Give me a shout if you want any help
-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by Tom Purcell <tp...@chariotsolutions.com>.
James

I just realized it seems I can edit the page. Do you want me to do it?

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


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by James Strachan <ja...@gmail.com>.
Ah great stuff Tom!

Would you mind if we added your example XML configuration to the wiki
- it might be helpful for others

On 7/19/06, Tom Purcell <tp...@chariotsolutions.com> wrote:
>
> 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.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by Tom Purcell <tp...@chariotsolutions.com>.
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.


Re: [heads up] example of configuring the JMS bridge using the XBean XML

Posted by James Strachan <ja...@gmail.com>.
On 7/13/06, Dan Hayes <dh...@chariotsolutions.com> wrote:
> James,
>
> How would the configuration file look if one end of the bridge was a
> non-ActiveMQ endpoint, such as a Weblogic JMS queue?

In this example...

http://incubator.apache.org/activemq/jms-to-jms-bridge.html

just change the spring XML for the remoteFactory POJO to create any
JMS ConnectionFactory

-- 

James
-------
http://radio.weblogs.com/0112098/