Announcement Announcement Module
Collapse
No announcement yet.
JmsTemplate.receiveSelected - timeout vs message not avaiable Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JmsTemplate.receiveSelected - timeout vs message not avaiable

    Hi,

    I set the

    jmsTemplate.setReceiveTimeout(10000);
    TextMessage txtMessage= (TextMessage) jmsTemplate.receiveSelected(destination, "JMSCorrelationID=messageid");

    Now txtMessage can be null in two scenarios
    (1) When there is no message for the given correlation id
    (2) When there is a time out happens (10 secs in this case).

    How do we distinguish between these 2 cases? I mean my requirement is if the message doesn't exist with the given correlation Id I want to perform some business logic. With this receiveSelected() I would not be sure if the required message is there or not.

    Should I use browseSelected() instead of receiveSelected()?

    Appreciate your inputs.

    Thanks, Kiran
Working...
X