Read from Weblogic , write to ActiveMQ
I 开发者_开发问答have the following scenario:
Read a message from a Weblogic queue and I have to write this to an ActiveMQ queue (transaction wise)
(i can't use JMS Bridge,Foreign JNDI for various reason that do not depend on me)
Is there a way of doing this ? using Spring ? or JCA ?
Thanks
Refer http://skaetech.webs.com/WeblogicToActiveMQ.pdf OR http://skaetech.webs.com/weblogic.htm It contains detailed description of how to set-up Bridge between Weblogic-ActiveMQ-Weblogic
Apache Camel is a good option here - it comes with ActiveMQ and can be embedded directly inside your broker config (just normal Spring, in activemq.xml used to start the broker); or you can use it independently of the broker in a standalone process.
To use it, you'd set up the connections for the two brokers, and have a route from a queue in Weblogic to an ActiveMQ equivalent. Here's a quick and dirty version:
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost"/>
</bean>
</property>
</bean>
<bean id="weblogic" class="org.apache.camel.component.jms.JmsComponent">
<!-- depends on a factory defined elsewhere -->
<property name="connectionFactory" ref="myWeblogicConnectionFactory"/>
</bean>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="weblogic:myInputQueue"/>
<to uri="activemq:myOutputQueue"/>
</route>
</camelContext>
Check out http://camel.apache.org/jms.html for more details. Hope that helps.
精彩评论