7 Replies Latest reply on Jan 7, 2009 8:02 AM by Tim Fox

    JMS Adapters for JBM 2 Bridge

    Jeff Mesnil Master

      I'm currently updating our BridgeService to make it work with JBM 2.

      One of the task is to change the way we created JMS managed resources for the bridge's source and target (we no longer require the adapters to be registered in JMX).

      In my local box, I've got a simple class JMSProviderAdapter which is instantiated by JBoss Microcontainer.
      The Bridge & adapters configuration looks like:

       <bean name="Bridge" class="org.jboss.messaging.jms.bridge.BridgeService">
       <constructor>
       <parameter>TestBridge</parameter>
       <parameter>
       <inject bean="JMSManagementService"/>
       </parameter>
       </constructor>
       <property name="sourceProvider">
       <inject bean="JBM_2_Provider"/>
       </property>
       <property name="targetProvider">
       <inject bean="JBM_2_Provider"/>
       </property>
       <property name="sourceDestinationLookup">/queue/A</property>
       <property name="targetDestinationLookup">/queue/B</property>
       <property name="failureRetryInterval">-1</property>
       <property name="maxRetries">-1</property>
       <property name="maxBatchSize">1</property>
       <property name="maxBatchTime">-1</property>
       <property name="qualityOfServiceMode">2</property>
       <property name="transactionManager">
       <inject bean="TransactionManager" />
       </property>
       </bean>
      
       <bean name="JBM_2_Provider" class="org.jboss.messaging.jms.bridge.JMSProviderAdapter">
       <constructor>
       <parameter>JBoss Messaging 2 Adapter</parameter>
       <parameter>
       <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
       <entry>
       <key>java.naming.factory.initial</key>
       <value>org.jnp.interfaces.NamingContextFactory</value>
       </entry>
       <entry>
       <key>java.naming.provider.url</key>
       <value>jnp://localhost:1099</value>
       </entry>
       <entry>
       <key>java.naming.factory.url.pkgs</key>
       <value>org.jboss.naming:org.jnp.interfaces"</value>
       </entry>
       </map>
       </parameter>
       <parameter>/ConnectionFactory</parameter>
       </constructor>
       </bean>
      
       <bean name="TransactionManager" class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
       </bean>
      


      With this kind of configuration, I was able to bridge a JBM 1.4 source to a JBM 2 target (the bridge was hosted in the JBM2 server).

      For each type of provider, you must add a bean description with all the JNDI properties required to lookup its JMS managed resources.
      Then all the class must be in JBM 2 classpath when it is started.

      I'm not familiar with JBM 1.4 Bridge configurations and I wanted to be sure that this way to configure JBM2 Bridge adapter is sufficient enough to cover all the cases.

        • 1. Re: JMS Adapters for JBM 2 Bridge
          Tim Fox Master

          I don't understand why you need to make any changes to the bridge to make it work with JBM 2.0.

          The bridge should work with any JMS 1.1 compliant provider. What am I missing here?

          • 2. Re: JMS Adapters for JBM 2 Bridge
            Jeff Mesnil Master

            Let me clarify a little bit.

            I'm not changing the Bridge class. I'm changing the BridgeService.

            in JBM 1.4, the BridgeService uses the JMX microkernel to get information on the JMS providers.
            in JBM 2, the Microcontainer will be used to do that.

            The only update for JBM2 is how I retrieve this information. Otherwise, I've not touched the bridge code.

            • 3. Re: JMS Adapters for JBM 2 Bridge
              Tim Fox Master

              I still don't follow, JMSProviderAdapters still exist in AS 5 AFAIK, so I don't see why anything needs to change.

              • 4. Re: JMS Adapters for JBM 2 Bridge
                Jeff Mesnil Master

                ok, now I'm the one who is confused.

                Do we keep the bridge service as it is? It means that we must depend on JBoss AS 5 and the JMX microkernel to have it work.
                I thought that we'd also want to have bridge when running JBM2 standalone.
                In that case, JBoss microcontainer'd be used to wire the JMS provider adapters.

                • 5. Re: JMS Adapters for JBM 2 Bridge
                  Tim Fox Master

                   

                  "jmesnil" wrote:
                  ok, now I'm the one who is confused.

                  Do we keep the bridge service as it is? It means that we must depend on JBoss AS 5 and the JMX microkernel to have it work.



                  For now the jms bridge is something that runs in JBoss AS 4.x or 5.x.



                  I thought that we'd also want to have bridge when running JBM2 standalone.


                  The bridge should still be able to bridge between JBM 2.0 instances even if it they are running stand-alone, as long as the bridge itself is running in a JBoss AS instance.

                  If you want to bridge between JBM2.0 instances you should use message flows.

                  In short, I don't see that we need to change anything in the bridge.

                  • 6. Re: JMS Adapters for JBM 2 Bridge
                    Jeff Mesnil Master

                     

                    "timfox" wrote:

                    For now the jms bridge is something that runs in JBoss AS 4.x or 5.x.


                    That's not the subject of this post but doesn't that mean the bridge code would be better put in the AS repo?

                    "timfox" wrote:

                    The bridge should still be able to bridge between JBM 2.0 instances even if it they are running stand-alone, as long as the bridge itself is running in a JBoss AS instance.


                    Ok, I thought that the bridge itself could be run in a JBM 2 standalone server (e.g. to bridge JBM 1.4 to JBM 2).
                    If the bridge must be running in a JBoss ASS instance, the modification is useless.

                    • 7. Re: JMS Adapters for JBM 2 Bridge
                      Tim Fox Master

                       

                      "jmesnil" wrote:

                      Ok, I thought that the bridge itself could be run in a JBM 2 standalone server (e.g. to bridge JBM 1.4 to JBM 2).


                      A JBM 2.0 standalone server is just the microcontainer with some services in it. The bridge can run in that as long as you deploy the service(s) that provide the JMSProviderAdapter functionality.

                      Seems like what you have done is duplicate that functionality.

                      In any case it's not a high priority. As long as customer have some way of bridging JMS messages from JBM 1.4/JBoss MQ/Other JMS provider <--> JBM 2.0 that is the important thing, since it solves their problem.

                      That functionality is already present, so even if this was desirable it is very low priority, and we have much more important things to do in the next couple of months :)