3 Replies Latest reply on Mar 25, 2012 10:08 AM by Nicholas DiPiazza

    JBoss 7.1.0.Final + IBM WMQ JCA resource adapater = No transaction-support?

    Nicholas DiPiazza Novice

      Question: We are trying to create EJB3 message driven bean powered by a IBM WMQ JCA resource adapter.

       

      We cannot seem to get transactions working. I looked on the internet and I could find no one with an wmq.jmsra.rar file resource adapter with <transaction-support>XATransaction</transaction-support>

       

      We have it running but it is failing to rollback the messages. The messages just retry 15 times and then never get put back on the queue.

       

      Has anyone ever gotten IBM WMQ transactions working?

        • 1. Re: JBoss 7.1.0.Final + IBM WMQ JCA resource adapater = No transaction-support?
          Justin Bertram Master

          Are you using the "extended transaction client" from IBM which enables XA transaction support for their JCA RA?

           

          Can you post your MDB test-case?

           

          Do you see any exceptions or ERROR/WARN messages?

          1 of 1 people found this helpful
          • 2. Re: JBoss 7.1.0.Final + IBM WMQ JCA resource adapater = No transaction-support?
            Nicholas DiPiazza Novice

            Yes we are using the extended transaction client from IBM.

             

            Working on the test case.

             

            No warnings nor errors in the logs.

            • 3. Re: JBoss 7.1.0.Final + IBM WMQ JCA resource adapater = No transaction-support?
              Nicholas DiPiazza Novice

              To install the IBM WMQ adapter, we added the wmq.jmsra.rar and application .ear file to the deployment dir and then put a msg on queue. It works great except for Transactions don't seem to work. They worked in JBoss 5.1 but we can't seem to get them to work with AS7.

               

              The bean I am testing this with is pretty simple:

               

              public class RepositoryNotificationListenerBean implements MessageDrivenBean, MessageListener{

                   private MessageDrivenContext context;

                        public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException {

                                  context = ctx;

                        };

                   public void onEjbCreate() {

                        }

                        public void onMessage(Message msg) {

                                  System.out.println(msg);

                                  getMessageDrivenContext().setRollbackOnly();

               

                        }

                        public MessageDrivenContext getMessageDrivenContext(){

                        return context;

                        }

               

                        public void ejbRemove() throws EJBException {

                        }

              }

               

              ejb-jar.xml

               

              <?xml version="1.0" encoding="UTF-8"?>

               

              <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                                          http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

                version="3.0">

                <display-name>ejb ndipiazza test</display-name>

                <enterprise-beans>

                <message-driven id="RepositoryNotificationListener">

                                            <ejb-name>RepositoryNotificationListener</ejb-name>

                                            <ejb-class>com.ndipiazza.RepositoryNotificationListenerBean</ejb-class>

                <transaction-type>Container</transaction-type>

                <message-destination-type>javax.jms.Queue</message-destination-type>

                <activation-config>

                <activation-config-property>

                <activation-config-property-name>destinationType</activation-config-property-name>

                <activation-config-property-value>javax.jms.Queue</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>destination</activation-config-property-name>

                <activation-config-property-value>NICK.TEST.OBJECT</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>hostName</activation-config-property-name>

                <activation-config-property-value>test.ndipiazza.host</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>port</activation-config-property-name>

                <activation-config-property-value>6500</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>channel</activation-config-property-name>

                <activation-config-property-value>NDD.CLIENT2</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>transportType</activation-config-property-name>

                <activation-config-property-value>CLIENT</activation-config-property-value>

                </activation-config-property>

                <activation-config-property>

                <activation-config-property-name>queueManager</activation-config-property-name>

                <activation-config-property-value>TEST1000ABC</activation-config-property-value>

                </activation-config-property>

                </activation-config>

                </message-driven>

                </enterprise-beans>

                <assembly-descriptor>

                <container-transaction>

                <method>

                                                      <ejb-name>RepositoryNotificationListener</ejb-name>

                <method-name>onMessage</method-name>

                </method>

                <trans-attribute>Required</trans-attribute>

                </container-transaction>

                </assembly-descriptor>

              </ejb-jar>

               

               

              Here is the resource adapter configuration from standalone.xml

               

               

              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                <resource-adapters>

                <resource-adapter>

                <archive>

                                                      wmq.jmsra.rar

                </archive>

                <transaction-support>XATransaction</transaction-support>

                <config-property name="traceEnabled">

                                                      true

                </config-property>

                <config-property name="traceLevel">

                                                      10

                </config-property>

                <connection-definitions>

                <connection-definition

                class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl"

                jndi-name="java:jboss/jms/WMQCF" enabled="true" pool-name="java:jboss/jms/WMQCF">

                <config-property name="port">

                                                                          60001

                </config-property>

                <config-property name="hostName">

                                                                          test.ndipiazza.host

                </config-property>

                <config-property name="channel">

                                                                          NDD.CLIENT2

                </config-property>

                <config-property name="transportType">

                                                                          CLIENT

                </config-property>

                <config-property name="queueManager">

                                                                          TEST1000ABC

                </config-property>

                <validation>

                <background-validation>false</background-validation>

                <background-validation-millis>0</background-validation-millis>

                </validation>

                </connection-definition>

                </connection-definitions>

                <admin-objects>

                <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy"

                jndi-name="java:jboss/jms/NICK.TEST.OBJECT" enabled="true"

                use-java-context="false" pool-name="java:jboss/jms/NICK.TEST.OBJECT">

                <config-property name="targetClient">

                                                                          JMS

                </config-property>

                <config-property name="baseQueueName">

                                                                          NICK.TEST.OBJECT

                </config-property>

                <config-property name="baseQueueManagerName">

                                                                          TEST1000ABC

                </config-property>

                </admin-object>

                </admin-objects>

                </resource-adapter>

                </resource-adapters>

              </subsystem>

               

               

              Everything works except transactions. Are we doing anything wrong?