Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-261

The Resource Adapter ignores the JMSXGroupID when dispatching to MDBs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBoss A-MQ 6.1
    • 7.1.0.fuse-046
    • None
    • None
    • JBoss EAP 6.0.1
      ActiveMQ RAR 5.8.0

      Steps to Reproduce:1. Download latest version EAP 6.x from (tested against 6.0.1 and 6.1):
      https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?downloadType=distributions&product=appplatform&productChanged=yes2. Download activemq-rar-5.8.0.rar to eap6/standalone/deployments:
      wget http://repo1.maven.org/maven2/org/apache/activemq/activemq-rar/5.8.0/activemq-rar-5.8.0.rar3. Build test_amp and test_amq_web using 'mvn package'4. Register activemq resource adapter in EAP 6:Edit eap6/standalone/configuration/standalone-full.xml and modify subsystem resource-adapters as:| <subsystemxmlns="urn:jboss:domain:resource-adapters:1.0">|

      <resource-adapters>
      <resource-adapter>
      <archive>
      activemq-rar-5.8.0.rar
      </archive>
      <transaction-support>XATransaction</transaction-support>
      <config-propertyname="UseInboundSession">
      false
      </config-property>
      <config-propertyname="Password">
      defaultPassword
      </config-property>
      <config-propertyname="UserName">
      defaultUser
      </config-property>
      <config-propertyname="ServerUrl">
      vm://localhost
      </config-property>
      <connection-definitions>
      <connection-definitionclass-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
      jndi-name="java:jboss/ConnectionFactory"enabled="true"pool-name="ConnectionFactory">
      <xa-pool>
      <min-pool-size>1</min-pool-size>
      <max-pool-size>20</max-pool-size>
      </xa-pool>
      </connection-definition>
      </connection-definitions>
      <admin-objects>
      <admin-objectclass-name="org.apache.activemq.command.ActiveMQQueue"
      jndi-name="java:jboss/queue/MyActiveMQQueue"use-java-context="true"pool-name="MyActiveMQQueue">
      <config-propertyname="PhysicalName">
      QueuePhysicalName
      </config-property>
      </admin-object>
      </admin-objects>
      </resource-adapter>
      </resource-adapters>
      </subsystem>

      5. Copy test_amq/target/test_amq.jar and test_amq_web/target/test_amq_web.jar in EAP6/standalone/deployment6. Start the server:cd EAP6/bin./standalone.sh --server-config=standalone-full.xml7. Access web app to execute tests:ActiveMQ test with JMSXGroupID: http://localhost:8080/test_amq_web/testFor comparison,HornetQ test with JMSXGroupID: http://localhost:8080/test_amq_web/test28 Expected output: The messages for same JMSXGroupID should be processed sequentially by the same MDB instance pool.9 Actual Output:When invoking the test_amq_web/test we can see that messages using the same JMSXGroupID[Group-1]are not being processed sequentially by the Consume-AMQ3 MDB Pool. World 0 is processed before Hello 0 is done. In the logs we get messages in this order:| 15:00:47,031 INFO [stdout] (default-threads - 7) Consume-AMQ3 Testing MDB : Hello 0[Group-1], com.redhat.gss.test.HandleMessage@53e59730|

      15:00:47,032 INFO [stdout] (default-threads - 7) Consume-AMQ3 Testing MDB : Hello 0[Group-1], com.redhat.gss.test.HandleMessage@53e59730 - Heavy processing for 5 seconds. Hello 0[Group-1], com.redhat.gss.test.HandleMessage@53e59730
      ...
      15:00:47,066 INFO [stdout] (default-threads - 12) Consume-AMQ3 Testing MDB : World 0[Group-1], com.redhat.gss.test.HandleMessage@5418f143
      ...
      15:00:52,035 INFO [stdout] (default-threads - 7) Consume-AMQ3 Testing MDB : Hello 0[Group-1], com.redhat.gss.test.HandleMessage@53e59730 Done!

      However when invoking test_amq_web/test2 (which uses HornetQ) we can see that the message are being processed sequentially. Hello 0 from Group-0 is done before World 0 from Group-0 is invoked.| 15:08:35,740 INFO [stdout] (Thread-1 (HornetQ-client-global-threads-1277578712)) Consume-HQ1 Testing MDB : Hello 0[Group-0], com.redhat.gss.test.HandleMessage@67092e88|

      15:08:35,744 INFO [stdout] (Thread-1 (HornetQ-client-global-threads-1277578712)) Consume-HQ1 Testing MDB : Hello 0[Group-0], com.redhat.gss.test.HandleMessage@67092e88 - Heavy processing for 5 seconds. Hello 0[Group-0], com.redhat.gss.test.HandleMessage@67092e88
      ...
      15:08:40,784 INFO [stdout] (Thread-0 (HornetQ-client-global-threads-1277578712)) Consume-HQ1 Testing MDB : Hello 0[Group-0], com.redhat.gss.test.HandleMessage@bce1791 Done!
      15:08:40,788 INFO [stdout] (Thread-0 (HornetQ-client-global-threads-1277578712)) Consume-HQ1 Testing MDB : World 0[Group-0], com.redhat.gss.test.HandleMessage@5e8ace0e

      Note, you can safely ignore this warning printed by EAP on startup:| ERROR [stderr] (JMX connector) Exception in thread "JMX connector" java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only|

        1. ActivationSpecConfiguration.png
          303 kB
          Joe Luo

              dejanbosanac Dejan Bosanac
              rhn-support-jshepher Jason Shepherd
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: