Announcement Announcement Module
No announcement yet.
How to get MDP, JBoss, and WMQ working together Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get MDP, JBoss, and WMQ working together

    Im using JBoss 4.2 and Websphere JCA MQ Connector . Im trying to create a spring MDP but Im receiving the following error:

    MQJCA1025:Message consumer must not have a message listener.;

    Looking at WMQs description for this message it states:

    An application attempted to set a message listener for a JMS message consumer. This exception occurs only if the application is running in a managed environment.

    So has anyone done this. If so can someone tell me whats wrong with what Im doing?

    <jee:jndi-lookup id="connectionFactory" jndi-name="java:QUEUE_MANAGER" />
    <jee:jndi-lookup id="destination" jndi-name="TEST_QUEUE" />
       <bean id="myMdp"  class="com.test.MyMdp" />
       <bean id="myMdpAdapter"
              class="org.springframework.jms.listener.adapter.MessageListenerAdapter" >
            <property name="delegate" ref="myMdp" />
            <property name="defaultListenerMethod" value="processMessage" />
            <property name="messageConverter">
                <null />
        <bean class="org.springframework.jms.listener.SimpleMessageListenerContainer" >
            <property name="connectionFactory" ref="connectionFactory" />
            <property name="destination" ref="destination" />
            <property name="messageListener" ref="myMdpAdapter" />

  • #2

    I'm seeing similar exceptions and can't find any documentation on using MDPs in JBoss with JCA.

    I can get the DefaultMessageListenerContainer working, but if my MDP throws a RuntimeException, the message isn't put back on the Queue (sessionTransacted == true).

    If I specify the JmsTransactionmanager in addition to sessionTransacted == true, then JCA complains when the DMLC calls commit(), saying the session is not transacted.


    • #3
      If I configure the DefaultMessageListenerContainer to use the JBoss TxM (currently on 4.0.5, so using the 'old' TxM) - the Websphere MQ JCA resource manager complains thusly:

      MQJCA1004istributed transactions are unavailable.
      Currently, I don't have the XA-capable MQ client JARs (supposedly in, and this seems to be needed if you're using the platform TxM, since receiving the message & processing the message are two separate UOWs, hence the need for XA.

      I'm trying to get the XA MQ client installed, I'll see how things fare with that.

      FYI, the ServerSessionMessageListenerContainer does not appear as though it can work with the Websphere MQ JCA adapter. Specifically, SSMLC is hard-coded to share connections and this appears to cause an Exception from the JCA adapter, which complains that a connection can only have one listener (I take this to mean: no sharing).