5 Replies Latest reply on Oct 24, 2012 10:50 AM by arkadiy

    MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1

    arunsanjay

      Hi

      The issue being , MDB does not pick up messages that are present in the queue. I have the below configuration  in the MDB

      @MessageDriven( name="MessageQueueServiceMDB",

      activationConfig =

      {

                  @ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),

                  @ActivationConfigProperty(propertyName = "destinationType",propertyValue ="javax.jms.Queue"),        

                  @ActivationConfigProperty(propertyName = "destination", propertyValue ="requestq"),

                  @ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),

                  @ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),

                  @ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QM_TEST"),

                  @ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),

                  @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),

                  @ActivationConfigProperty(propertyName = "username", propertyValue = "vhk834")

       

      })

      @ResourceAdapter("wmq.jmsra.rar")

      public class MessageQueueServiceMDB implements MessageListener {

      .....

      }

       

      Have defined the resource adapter definition in standalone-full.xml as below,

       

      <resource-adapter>

                          <archive>

                              wmq.jmsra.rar

                          </archive>

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

                          <connection-definitions>

                              <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/MQConnectionFactory" use-java-context="true" pool-name="connectionfactorypool">

                                  <config-property name="port">

                                      1414

                                  </config-property>

                                  <config-property name="hostName">

                                        localhost

                                  </config-property>

                                  <config-property name="username">

                                      vhk834

                                  </config-property>

                                  <config-property name="channel">

                                      SYSTEM.DEF.SVRCONN

                                  </config-property>

                                  <config-property name="transportType">

                                      CLIENT

                                  </config-property>

                                  <config-property name="queueManager">

                                      QM_TEST

                                  </config-property>

                              </connection-definition>

                          </connection-definitions>

                          <admin-objects>

                              <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/requestq" use-java-context="true" pool-name="queuepool">

                              </admin-object>

                          </admin-objects>

                      </resource-adapter>

       

      I have deployed the wmq.jmsra.rar in JBoss AS 7 . The application is also deployed successfully , going through the logs it does say the MDB is started. In order to verify whether the MDB is bound , inhibited GET on the queue in  Websphere MQ Explorer. The Application started to throw exceptions stating MQ_GET_INHIBITED error .This conformed that the MDB is actually bound to the queue.  However the MDB does not pickup any message from the queue.  Any suggestions please?

       

      I did go through the discussion https://community.jboss.org/thread/200690, which had one answer of moving forward to a 7.2.x build the problem was resolved, but is it the only solution?

        • 1. Re: MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1
          arunsanjay

          Got this resolved.  I missed reading through the logs properly, The issue was by default Transaction Attribute will be Required, due to which it was looking for distributed transaction client , due to which the MDB deployment failed. Since there is no update of managed entities happening from the MDB changed the TransactionAttribute to NOT_SUPPORTED and worked fine. Would like to know if it is possible to externalize the activation config properties from the MDB , I am aware it could be defined in jboss-ejb3.xml, but is it possible have them defined as system properties in the standlone-full.xml and have them used in the jboss deployment descriptor. I did go through the issue https://community.jboss.org/thread/204025. ; tried it out but looks like the property is unavailable in 7.1.1 . Is it correct?

          1 of 1 people found this helpful
          • 2. Re: MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1
            jbertram

            As you suspected, system property substitution in jboss-ejb3.xml is not available in AS 7.1.1.  You'd need to get a AS 7.2.0.Alpha nightly to get that functionality (or backport the fix from AS7-3816 and rebuild AS 7.1.1).

            • 3. Re: MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1
              arkadiy

              I followed the AS7-3816 link and did not find the references to the code that has to be added to the existing 7.1.1 to enable system property substitution.

              Please, advise where I can find it.

              • 4. Re: MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1
                jbertram

                I believe you're looking for https://github.com/jbossas/jboss-as/commit/4bdf4210f50454a4091115bc0ae87a3a0942a25b which is referenced from AS7-4479 (which is a dependency of AS7-3816).

                • 5. Re: MDB not consuming Messages - Websphere MQ 7 JBoss AS 7.1.1
                  arkadiy

                  Thanks for the link to the properties substitution fix.

                  I updated the code with a fix and tried to build the JBoss.

                  I was able to do it before implementing changes, but after implementation there are such errors:

                   

                  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (def
                  ault-testCompile) on project jboss-as-protocol: Compilation failure: Compilation failure:
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\support\Simple
                  Handlers.java:[128,80] <anonymous org.jboss.as.protocol.mgmt.support.SimpleHandlers$AbstractHandler$
                  1> is not abstract and does not override abstract method execute(org.jboss.as.protocol.mgmt.Manageme
                  ntRequestContext) in org.jboss.as.protocol.mgmt.ManagementRequestContext.AsyncTask
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\support\Simple
                  Handlers.java:[129,16] method does not override or implement a method from a supertype
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\support\Simple
                  Handlers.java:[215,60] cannot access Channel.Receiver
                  [ERROR] class file for Channel.Receiver not found
                  [ERROR] channel.receiveMessage(ManagementChannelReceiver.createDelegating(client));
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\support\Remote
                  ChannelPairSetup.java:[94,67] cannot find symbol
                  [ERROR] symbol  : method createDelegating(org.jboss.as.protocol.mgmt.ManagementMessageHandler)
                  [ERROR] location: class org.jboss.as.protocol.mgmt.ManagementChannelReceiver
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\RemoteChannelM
                  anagementTestCase.java:[211,84] <anonymous org.jboss.as.protocol.mgmt.RemoteChannelManagementTestCas
                  e$2$1> is not abstract and does not override abstract method execute(org.jboss.as.protocol.mgmt.Mana
                  gementRequestContext) in org.jboss.as.protocol.mgmt.ManagementRequestContext.AsyncTask
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\RemoteChannelM
                  anagementTestCase.java:[212,20] method does not override or implement a method from a supertype
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\RemoteChannelM
                  anagementTestCase.java:[242,84] <anonymous org.jboss.as.protocol.mgmt.RemoteChannelManagementTestCas
                  e$3$1> is not abstract and does not override abstract method execute(org.jboss.as.protocol.mgmt.Mana
                  gementRequestContext) in org.jboss.as.protocol.mgmt.ManagementRequestContext.AsyncTask
                  [ERROR] \workspaceJBoss7.1.1_source\protocol\src\test\java\org\jboss\as\protocol\mgmt\RemoteChannelM
                  anagementTestCase.java:[243,20] method does not override or implement a method from a supertype

                   

                  I would appreciate any advise. This is our last barrier in migration from JBoss 5.1 to JBoss 7.x