1

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

Cris
  • 4,947
  • 6
  • 44
  • 73

2 Answers2

3

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

1

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.

Jakub Korab
  • 4,974
  • 2
  • 24
  • 34
  • Thank you very much...this can be considered as an extended transaction ? – Cris Sep 15 '11 at 09:06
  • 1
    I don't know what you mean by extended transaction, but Camel acts as just another consumer on myInputQueue, and a producer on myOutputQueue. If you want the route's activity to be transacted, just add the following to your spring config: – Jakub Korab Sep 15 '11 at 09:30
  • Sorry for not being more precise...yes i want this read from input queue ,write to output queue to be considered as a transaction – Cris Sep 15 '11 at 10:04