1

I am implementing Spring MDP + JMSTemplate to send and receive the message. The message send mechanism is working fine, however the MDP is not getting invoked. I tried testing the via plain receiver, and was able to retrieve the message, but not via MDP. What could be the problem? I can see the messages getting accumulated in the request queue, but somehow the MDP is not getting trigger. Am I missing anything here in configurations or something else needs to be taken care of?

Here's the Spring Config. The Java class to send and received are pretty much standard ones.

    <bean id="cookieRequestListener" class="com.text.jms.mq.mdp.RequestQueueMDP">
        <property name="logger" ref="mqLogger" />
        <property name="scoringEngine" ref="scoringEngine" />
        <property name="mqSender" ref="jmsMQSender" />
        </bean>

    <bean id="CookieRequestContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="connectionFactory" ref="cachedConnectionFactory" />
        <property name="destination" ref="jmsRequestQueue" />
        <property name="messageListener" ref="cookieRequestListener" />
    </bean>

    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>
        <property name="jndiName">
            <value>java:/jms/queueCF</value>
        </property>
    </bean>

    <!-- A cached connection to wrap the Queue connection -->
    <bean id="cachedConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
        <property name="targetConnectionFactory" ref="jmsConnectionFactory"/>
        <property name="sessionCacheSize" value="10" />
    </bean>


    <!-- jms Request Queue Configuration -->
    <bean id="jmsRequestQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>
        <property name="jndiName">
            <value>java:/jms/cookieReqQ</value>
        </property>
    </bean>

    <!-- jms Response Queue Configuration -->
    <bean id="jmsResponseQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate">
            <ref bean="jndiTemplate" />
        </property>
        <property name="jndiName">
            <value>java:/jms/cookieResQ</value>
        </property>
    </bean>

    <bean id="jmsJMSTemplate" class="org.springframework.jms.core.JmsTemplate" >
        <property name="connectionFactory" ref="cachedConnectionFactory" />
    </bean>

    <!-- jms MQ Utility -->
    <bean id="jmsMQSender" class="com.text.jms.util.MQSender">
        <property name="jmsTemplate">
            <ref bean="jmsJMSTemplate"></ref>
        </property>
        <property name="defaultDestination">
            <ref bean="jmsRequestQueue" />
        </property>
        <property name="logger" ref="mqLogger" />
    </bean>
Amol Aranke
  • 51
  • 1
  • 5
  • did you extend the messagelistener class? – Zeus Jul 09 '14 at 19:14
  • Zeus, Can you elaborate more when you say extending Messagelistener class? – Amol Aranke Jul 10 '14 at 06:33
  • Zeus, if you mean implementing the MessageListener in MDP, then yes I have done that. – Amol Aranke Jul 10 '14 at 09:27
  • Hi, Do we need to configure anything in the server side (JBoss Mgmt Console) such as listener which will ensure the messages are getting consumed? Something similar to listener that we add in Websphere App server for MDB? – Amol Aranke Jul 14 '14 at 06:24

0 Answers0