1 Reply Latest reply on Dec 17, 2011 11:42 AM by akrambenaissi

    JBoss Bridge between JBoss Messaging and remote MQ Series

    zecas

      Hi,

       

      I'm starting this discussion because I'm trying to create a bridge between JBoss and MQ Series, without success, and at the same time trying to get some knowledge on how JBoss works.

       

      My application is in JBoss 5.1.0 GA, and I'm using MDB from EJB3 spec. My final queues are stored in a remote MQ Series, and I want my JBoss to pull/push messages to that server.

       

      Versions:

      JBoss 5.1.0 GA

      Java JDK 1.6.0

      WebSphere MQ 7.0.1 (on remote machine, 192.168.1.30:1414)

       

      MQSeries 7.x:

      IP: 192.168.1.30

      Port: 1414

      Queue Manager: QM_server01

      Channel: SYSTEM.DEF.SVRCONN

      Queue: SourceQ

       

      On JBoss, my MDB will have something basic like:

       

      @MessageDriven(
              activationConfig = {
                      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
                      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/TestQ"),
              })
      public class TestMQ implements MessageListener {
       
          public void onMessage(Message message) {
              System.out.println(message.toString());
          }
       
      }
      

       

      My first step will be to receive messages from MQ Series TestQ in this MDB, so I was looking into configuring a bridge that will pull messages from the MQ Series SourceQ into JBoss queue (queue/TestQ).

       

      First I deployed info about the JBoss queue in C:\...\jboss-5.1.0.GA\server\default\deploy\TestQ-service.xml:

       

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <server>
          <mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=TestIncoming" code="org.jboss.jms.server.destination.QueueService">
              <attribute name="JNDIName">queue/TestQ</attribute>
              <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
              <depends>jboss.messaging:service=PostOffice</depends>
          </mbean>
      </server>
      

       

      Next step, I defined the MQ provider in C:\...\jboss-5.1.0.GA\server\default\deploy\jms-ds.xml:

       

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <connection-factories>
      <!-- Remote JMS Provider -->
      <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=com.ibm.mq.jms.context.WMQInitialContextFactory
      java.naming.provider.url=192.168.1.30:1414/SYSTEM.DEF.SVRCONN
      java.naming.security.authentication=none
      </attribute>
      </mbean>
      </connection-factories>
      

       

      Last step, I defined the bridge, that will connect to the remote MQ SourceQ and pull all messages into the local queue/TestQ. Definition was deployed in C:\...\jboss-5.1.0.GA\server\default\deploy\wmq-bridge-service.xml:

       

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
      <server> 
          <mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.jms:service=Bridge,name=TestBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml"> 
              <depends optional-attribute-name="SourceProviderLoader">jboss.jms:service=JMSProviderLoader,name=MyRemoteJMSProvider</depends> 
              <depends optional-attribute-name="TargetProviderLoader">jboss.jms:service=JMSProviderLoader,name=JMSProvider</depends> 
              <attribute name="SourceDestinationLookup">/SourceQ</attribute> 
              <attribute name="TargetDestinationLookup">/queue/TestQ</attribute> 
              <!--<attribute name="SourceUsername">src-usr</attribute> 
              <attribute name="SourcePassword">src-pwd</attribute> 
              <attribute name="TargetUsername">trg-usr</attribute> 
              <attribute name="TargetPassword">trg-pwd</attribute>--> 
              <attribute name="QualityOfServiceMode">2</attribute> 
              <!--<attribute name="Selector">specify-jms-selector-here</attribute>--> 
              <attribute name="MaxBatchSize">1</attribute> 
              <attribute name="MaxBatchTime">-1</attribute> 
              <!--<attribute name="SubName">mysub</attribute> 
              <attribute name="ClientID">myClientID</attribute>--> 
              <attribute name="FailureRetryInterval">5000</attribute> 
              <attribute name="MaxRetries">-1</attribute> 
              <!--<attribute name="AddMessageIDInHeader">false</attribute>--> 
          </mbean> 
      </server>

       

      I have no application deployed, nothing that uses the queue. I'm just trying to startup JBoss, but I get the following error:

       

      2011-10-14 14:43:17,417 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/monitor 
      2011-10-14 14:43:17,463 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "jboss.jms:name=TestBridge,service=Bridge" is missing the following dependencies:
          Dependency "jboss.jms:name=JMSProvider,service=JMSProviderLoader" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jms:name=JMSProvider,service=JMSProviderLoader' **")
      
      DEPLOYMENTS IN ERROR:
        Deployment "jboss.jms:name=JMSProvider,service=JMSProviderLoader" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jms:name=JMSProvider,service=JMSProviderLoader' **
      
      2011-10-14 14:43:17,526 INFO  [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080 
      2011-10-14 14:43:17,542 INFO  [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 
      2011-10-14 14:43:17,557 INFO  [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 26s:94ms
      

       

      I also have the following dependency libs:

       

      Directory of C:\...\jboss-5.1.0.GA\server\default\lib 
      30-03-2011  10:21           698.737 commonservices-2.3.jar 
      30-03-2011  10:21           446.549 defaultconfig-2.3.jar 
      30-03-2011  10:21         2.011.835 dhbcore-1.0.jar 
      30-03-2011  10:21           356.293 headers-2.3.jar 
      30-03-2011  10:21         1.904.071 jmqi-2.3.jar 
      30-03-2011  10:21           438.016 mq-2.3.jar 
      30-03-2011  10:21            17.657 mqcontext-2.3.jar 
      30-03-2011  10:21         3.229.664 mqjms-1.1.jar 
      30-03-2011  10:21            13.968 Nojndi-2.3.jar 
      30-03-2011  10:21           103.980 pcf-1.4.2.jar 
      30-03-2011  10:21           124.522 pcf-6.1-6.1.jar 
      30-03-2011  10:21         7.758.362 postcard-2.3.jar 
      30-03-2011  10:21           893.796 rmm-1.0.jar 
      30-03-2011  10:21           101.628 soap-1.4.2.jar 
      30-03-2011  10:21            31.996 tools.ras-1.4.2.jar
      

       

       

      Can anyone please explain to me what can be wrong? What am I missing, or doing wrong?

       

       

      Thanks.

        • 1. Re: JBoss Bridge between JBoss Messaging and remote MQ Series
          akrambenaissi

          Hi Zecas,

          It looks like you are not referring correctly to MyJMSProvider:

           

          {code:xml}<depends optional-attribute-name="SourceProviderLoader">

                    jboss.jms:service=JMSProviderLoader,name=MyRemoteJMSProvider</depends>

          {code:xml}

           

          Try to use this declaration instead:

          {code:xml}<depends optional-attribute-name="SourceProviderLoader">

                    jboss.jms:name=MyRemoteJMSProvider,service=JMSProviderLoader</depends>

          {code:xml}

           

          And the same way, the default JMSProvider that you are using is registered under jms.messaging:

          {code:xml}<depends optional-attribute-name="TargetProviderLoader">

              jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>

          {code:xml}

          Greetings

          Akram