3 Replies Latest reply on Mar 25, 2009 7:39 AM by Karen Kramer

    Need help with configuring message bridge from JBM-1.4.03SP3

    Karen Kramer Newbie

      We are deploying an application on JBoss EAP 4.3.0 using JBM 1.4.0 SP3 and have successfully deployed with multiple queues and can successfully send messages and process them using MDB's.
      We have one queue that needs to send messages to a queue that belongs to another internal application that is running in a standalone server JBOSS 4.0.5 with JMS that is JBossMQ. We thought that a messaging bridge would be the solution. (comments welcome here?)

      So, I tried to follow the instructions that I found and did some other net surfing and came up with this:

      1. test-bridge-service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=TestBridge"
       xmbean-dd="xmdesc/Bridge-xmbean.xml">
       <!-- This SourceProviderLoader is for this application ..so I use the default provider -->
       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
      
       <!-- This TargetProviderLoader is for connecting to the extenal application ...I've tried to define this in jms-ds.xml...this part is confusing me a bit -->
       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider</depends>
      
       <!-- Yes, these queues are named identically on both servers ! -->
       <attribute name="SourceDestinationLookup">/queue/DisputeStatusMessageQueue</attribute>
       <attribute name="TargetDestinationLookup">/queue/DisputeStatusMessageQueue</attribute>
       <attribute name="TargetUsername">guest</attribute>
       <attribute name="TargetPassword">guest</attribute>
       <attribute name="QualityOfServiceMode">0</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>



      2. jms-ds.xml

      I used this as a sample: http://wiki.jboss.org/wiki/JBMBridgeConfiguration
      I'm not clear if MyRemoteJMSProvider should be using "messaging classes" or "JBossMQ" classes. Also, I don't think that I need HAJNDI, but otherwise how would you know the IP address and port number to connect to? I didn't see any other place to put that info.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <connection-factories>
      
       <!-- The JMS provider loader -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.jms:service=JMSProviderLoader,name=JMSProvider">
       <attribute name="ProviderName">DefaultJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
       </attribute>
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- Uncomment to use HAJNDI to access JMS
       <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:1100
       </attribute>
       -->
       </mbean>
      
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider">
       <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=192.168.1.172:1099
       </attribute>
      </mbean>
      
      
      
       <!-- The server session pool for Message Driven Beans -->
       <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
       name="jboss.jms:service=ServerSessionPoolMBean,name=StdJMSPool">
       <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
       <attribute name="PoolName">StdJMSPool</attribute>
       <attribute name="PoolFactoryClass">
       org.jboss.jms.asf.StdServerSessionPoolFactory
       </attribute>
       </mbean>
      
       <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
       <tx-connection-factory>
       <jndi-name>JmsXA</jndi-name>
       <xa-transaction/>
       <rar-name>jms-ra.rar</rar-name>
       <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
       <max-pool-size>20</max-pool-size>
       <security-domain-and-application>JmsXARealm</security-domain-and-application>
       </tx-connection-factory>
      
      </connection-factories>
      


      3. Here's the provider that is sitting on the remote server..just the bean

      <!-- The JMS provider loader -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
       <attribute name="ProviderName">DefaultJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
       </attribute>
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- Uncomment to use HAJNDI to access JMS
       <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:1100
       </attribute>
       -->
       </mbean>


      4. Deployment error

        • 1. Re: Need help with configuring message bridge from JBM-1.4.0
          Karen Kramer Newbie

          Deployment error

          19:14:03,179 INFO [Server] JBoss (MX MicroKernel) [4.3.0.GA (build: SVNTag=JBPAPP_4_3_0_GA date=200801031548)] Started
          in 1m:48s:744ms
          19:26:49,180 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

          --- MBeans waiting for other MBeans ---
          ObjectName: jboss.messaging:service=Bridge,name=TestBridge
          State: CONFIGURED
          I Depend On:
          jboss.messaging:service=JMSProviderLoader,name=JMSProvider

          --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: jboss.messaging:service=JMSProviderLoader,name=JMSProvider
          State: NOTYETINSTALLED
          Depends On Me:
          jboss.messaging:service=Bridge,name=TestBridge


          ********************************************

          I guess that I overran my space above!!

          I would be so grateful for any comments or help!

          • 2. Re: Need help with configuring message bridge from JBM-1.4.0
            Matthew Meyers Newbie

            Not sure if it helps you but I noticed that with the example test-bridge-service.xml it is doing the jndi lookup for:

            jboss.messaging:service=JMSProviderLoader,name=DefaultJMSProvider

            This is not registered, perhaps it was in the 4.2 when messaging was manually deployed following there instructions. The correct registered path in my 4.3 eap distro is:

            jboss.jms:service=JMSProviderLoader,name=DefaultJMSProvider


            Cheers,

            - Matthew

            • 3. Re: Need help with configuring message bridge from JBM-1.4.0
              Karen Kramer Newbie

              Thanks for responding! You're correct!

              Since that original question, I have managed to get a messaging bridge working and I will share the code to maybe help others.

              outgoing-bridge-service.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <server>
              <mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.jms:service=ISACBridge,name=ISAC
              Bridge" xmbean-dd="xmdesc/Bridge-xmbean.xml">
               <depends optional-attribute-name="SourceProviderLoader">jboss.messaging.destination:service=Queue,name=DisputeStatusMessageQueue</depends>
               <depends optional-attribute-name="TargetProviderLoader">jboss.jms:service=JMSProviderLoader,name=MyRemoteJMSProvider</depends>
               <depends optional-attribute-name="SourceProviderLoader">jboss.jms:service=JMSProviderLoader,name=JMSProvider</depends>
               <attribute name="TargetUsername">guest</attribute>
               <attribute name="TargetPassword">guest</attribute>
               <!-- These are two separate queues that have been named identically -->
               <attribute name="SourceDestinationLookup">/queue/DisputeStatusMessageQueue</attribute>
               <attribute name="TargetDestinationLookup">/queue/DisputeStatusMessageQueue</attribute>
               <!-- QualityOfServiceMode = 2 means that messages are delivered "Once and Only Once" -->
               <attribute name="QualityOfServiceMode">2</attribute>
               <!-- MaxBatchSize = 5 means that the bridge will wait until there are 5 messages before sending and then send as a batch -->
               <attribute name="MaxBatchSize">5</attribute>
               <!-- MaxBatchTime = 4000 means if the batch size is not reached with this period, it will send what is there (ms) -->
               <attribute name="MaxBatchTime">4000</attribute>
               <!-- FailureRetryInterval = 5000 means if there is a connection failure, it will retry (ms) -->
               <attribute name="FailureRetryInterval">5000</attribute>
               <!-- MaxRetries = -1 means to keep trying indefinitely -->
               <attribute name="MaxRetries">-1</attribute>
               <attribute name="AddMessageIDInHeader">false</attribute>
              </mbean>
              </server>


              remote-jms-ds.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <connection-factories>
              <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.jms:service=JMSProviderLoader,name=MyRemoteJMSProvider">
               <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=jnp://172.16.90.68:1099
               </attribute>
              </mbean>
              </connection-factories>