Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to combine synchronous and asyncronous receiving on same queue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


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

      Comment

      Working...
      X