2 Replies Latest reply on Sep 11, 2008 3:47 PM by karen.kramer

    Need help with configuring message bridge from JBM-1.4.0SP3(

    karen.kramer

      I did post this in beginner's corner last week and got no responses so I hope this is not a problem to re-post here:

      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 t
      his 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 = ?????

      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 would be so grateful for any comments or help!



        • 1. Re: Need help with configuring message bridge from JBM-1.4.0
          samdoyle

          I see the exact same error as well. Getting the bridge to work as been a pain.

          • 2. Re: Need help with configuring message bridge from JBM-1.4.0
            karen.kramer

            Well I was able to get it to work, so this may help you:

            Putting everything in one file --- jms-ds.xml, seemed to solve the deployment probem. This following code works successfully for forwarding a message from a queue on a server with JBM and to JBossMQ with the Bridge being deployed on the server using JBM. You would only need to change the queue names and the IP address of the remote server.

            This is my jmx-ds.xml file

            <?xml version="1.0" encoding="UTF-8" ?>
            <connection-factories>
            
            <!-- The JMS provider loader -->
            <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging: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">XAConnectionFactory</attribute>
             <!-- The queue connection factory -->
             <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
             <!-- The topic factory -->
             <attribute name="TopicFactoryRef">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=RemoteJMSProvider">
             <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=172.31.19.57:1399
             </attribute>
             </mbean>
            
             <mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=TestBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml">
             <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
             <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends>
             <attribute name="SourceDestinationLookup">/queue/DisputeStatusMessageQueue</attribute>
             <attribute name="TargetDestinationLookup">/queue/DisputeStatusMessageQueue</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>
            
            <!-- The server session pool for Message Driven Beans -->
            <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader" name="jboss.messaging: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>


            Good Luck!