Announcement Announcement Module
Collapse
No announcement yet.
JMS Listener "Response destination" not working as expected Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS Listener "Response destination" not working as expected

    Hi,
    I am using the JMS Listener namespace to configure the message listeners. My message listener uses the MessageListsnerAdapter and have defined the delegate class to handle the message with a response. I am able to receive messages but the response message fails with the error "Request message does not contain reply-to destination, and no default response destination set"
    But, I have defined the response destination in the bean configuration as shown below.
    I am completely clueless as how to handle sending back the response.
    Thanks for any help.
    Javid
    Code:
    <jms:listener-container concurrency="${jms.listenerconcurrency.size}" 
           <jms:listener destination="myqueue.request" 
    	    ref="requestMessageConsumer" response-destination="myqueue.response"/>
    </jms:listener-container>
    
    <bean id="requestMessageConsumer" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
            <property name="defaultListenerMethod" value="processRequest" />
    	<property name="messageConverter">
    			<bean class="org.springframework.jms.support.converter.SimpleMessageConverter" />
    	</property>
    	<constructor-arg>
          		<bean class="com.company.jms.RequestMessageConsumer">
          			<property name="xmlMapperImpl" ref="xmlMapperImpl" />
          		</bean>
        	</constructor-arg>
    </bean>

  • #2
    You are defining a MessageListenerAdapter implementation and then passing that into the namespace support that would have created one for you. Can you try changing to ref="yourRequestMessageConsumerBean" and method="processRequest". Then add the MessageConverter reference to the <listener-container> element.

    Comment


    • #3
      Hi Mark,
      I am not sure if I am following you.
      If I just change the ref property to a value like "yourRequestMessageConsumerBean", I get Invalid bean property, which I believe its because I dont have that bean defined. I tried the following but still doesn't work.
      I can clearly understand I am doing something wrong but not sure what it is. If possible, can you post me a small example.
      Thanks,
      Javid

      Code:
      <jms:listener-container concurrency="${jms.listenerconcurrency.size}" >
      	    <jms:listener destination="myqueue.request" 
      	    ref="requestMessageConsumer" method="processRequest"
      	    response-destination="myqueue.response"/>
      	</jms:listener-container>
      	
      	<bean id="requestMessageConsumer" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
      		<constructor-arg>
            		<bean class="com.company.jms.RequestMessageConsumer">
            			<property name="xmlMapperImpl" ref="xmlMapperImpl" />
            		</bean>
          	</constructor-arg>
      	</bean>

      Comment


      • #4
        Sorry. I should have been more explicit. Currently you have an inner bean of type: "com.company.jms.RequestMessageConsumer". If you make that a top-level bean, and give it an ID, then use that ID in the ref. You can remove the "requestMessageconsumer" bean that you currently have defined.

        Let me know if that is clear.

        Thanks,
        Mark

        Comment


        • #5
          Perfect. works great.
          Thanks so much Mark.

          Comment

          Working...
          X