Results 1 to 5 of 5

Thread: JMS Listener "Response destination" not working as expected

  1. #1

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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.

  3. #3

    Default

    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>

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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

  5. #5

    Default

    Perfect. works great.
    Thanks so much Mark.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •