5 Replies Latest reply on May 31, 2009 3:25 AM by gaohoward

    Configuring the JMS Bridge

      I've got two JBoss 5.0.1.GA instances. Server A has a topic and I would like to have bridged to a Queue on Server B.

      I've added the following to Server B's deploy/messaging/jms-ds.xml

      <!-- Remote JMS Provider -->
      <mbean
       code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider,server=remotehost">
       <attribute name="ProviderName">RemoteXAConnectionFactory</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1199
       </attribute>
      </mbean>
      


      I then created a file {Server B}/deploy/messaging/dfm-bridge-service.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      
      <mbean
       code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.jms:service=Bridge,name=DFMBrdige"
       xmbean-dd="xmdesc/Bridge-xmbean.xml">
       <depends optional-attribute-name="SourceProviderLoader">
       jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider,server=remotehost
       </depends>
       <depends optional-attribute-name="TargetProviderLoader">
       jboss.messaging:service=JMSProviderLoader,name=JMSProvider
       </depends>
      
       <attribute name="SourceDestinationLookup">/topic/noticeTopic</attribute>
       <attribute name="TargetDestinationLookup">/queue/ingestRemote</attribute>
       <attribute name="QualityOfServiceMode">2</attribute>
       <attribute name="MaxBatchSize">5</attribute>
       <attribute name="MaxBatchTime">-1</attribute>
       <attribute name="FailureRetryInterval">5000</attribute>
       <attribute name="MaxRetries">-1</attribute>
       <attribute name="AddMessageIDInHeader">false</attribute>
      </mbean>
      </server>
      


      I start up both servers and everything seems happy, including a message on

      I've connected a very simple MDB to the queue on Server B
      @MessageDriven(activationConfig = {
       @ActivationConfigProperty(
       propertyName = "destinationType",
       propertyValue = "javax.jms.Queue"),
       @ActivationConfigProperty(
       propertyName = "destination",
       propertyValue = "queue/ingestRemote"),
       @ActivationConfigProperty(
       propertyName = "maxSession",
       propertyValue = "1")
       })
      public class IngestDFMMDB implements MessageListener {
       private final Log log = LogFactory.getLog(getClass());
      
       public void onMessage(Message msg) {
       log.fatal("DFM message received: " + msg);
       }
      }
      


      I send messages to Server A's topic and detect that they have been sent via a JUnit test, but no message ever makes it to Server B's queue.

      I've been following the instructions from here: http://www.jboss.org/community/wiki/JBMBridgeConfiguration

      Any ideas why my MDB never gets called?

        • 1. Re: Configuring the JMS Bridge
          gaohoward

          Hi did you see any error information in the server.log file?

          Also, make sure the two nodes' serverPeerIDs are different from each other.

          • 2. Re: Configuring the JMS Bridge

            I didn't see any error information in either server's log. I'm running this again to verify that I didn't just over look something.

            As for the ServerPeerID's, I did not explicitly set it on either server. However I've been using different jboss.service.binding.set values for the two. Does that change the ServerPeerID? I haven't seen any warnings or errors related to the PostOffice during startup of either server.

            • 3. Re: Configuring the JMS Bridge

              Verified: No errors or warnings for either the Bridge or PostOffice.

              I also set different -Djboss.messaging.ServerPeerID for each of my server instances.

              Does the bridge REQUIRE a selector? I don't have one set.

              • 4. Re: Configuring the JMS Bridge

                This is either a bug or else the documentation is misleading...

                I moved the remote JMS provider MBean into its own file (instead of adding it to jms-ds.xml) and now my messages are flowing.

                • 5. Re: Configuring the JMS Bridge
                  gaohoward

                  hi,

                  the bridge example is just using the JMS provider in jms-ds.xml. So this shouldn't be an issue.
                  Did you try the example?

                  Thanks