Results 1 to 3 of 3

Thread: Is it possible to combine synchronous and asyncronous receiving on same queue

  1. #1
    Join Date
    Feb 2006
    Posts
    23

    Default Is it possible to combine synchronous and asyncronous receiving on same queue

    Hi

    I have a Spring application that sends JMS Messages using JmsTemplate (to QueueA). I have a requirement to wait specified time for an answer from other queue (QueueB) using JmsTemplate.setReceiveTimeout and JmsTemplate.receiveSelected(QueueB, messageSelector). If no synchronous reply is received, method will return and MDP (Implementation of MessageListener used by DefaultMessageListenerContainer) will handle message asynchronously.

    My problem is that all received messages are going to MDP. Is this kind of scenario even possible?

    Anyone?


    Best Regards

    Teemu

  2. #2
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    Quote Originally Posted by t1589 View Post
    Hi

    I have a Spring application that sends JMS Messages using JmsTemplate (to QueueA). I have a requirement to wait specified time for an answer from other queue (QueueB) using JmsTemplate.setReceiveTimeout and JmsTemplate.receiveSelected(QueueB, messageSelector). If no synchronous reply is received, method will return and MDP (Implementation of MessageListener used by DefaultMessageListenerContainer) will handle message asynchronously.

    My problem is that all received messages are going to MDP. Is this kind of scenario even possible?

    Anyone?


    Best Regards

    Teemu
    I don't see any benefit of the processing you described in comparison with the following one:
    1. Introduce dedicated helper class that inputs the data to send and callback for the response processing;
    2. That class teaches internal MDP about where to put the response and performs jms sending;
    3. When the response arrives to the MDP it's delivered to the provided callback;


    I.e. there is no point in synchronous jms recieval for specified amount of time.

  3. #3
    Join Date
    Feb 2006
    Posts
    23

    Default

    Thanks for pointing me to right direction! I managed to solve my problem.

Posting Permissions

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