How to set waiting timeout on JmsMessagingTemplate.sendAndReceive
Asked Answered
R

2

7

I'm using sendAndReceive from JmsMessagingTemplate in an MVC controller but if no reply message is sent it seems to keep waiting on a reply forever. The documentation states that:

Returns: the reply, possibly null if the message could not be received, for example due to a timeout

However I just can't figure out after how long a timeout is given or where to configure this. Can someone explain this to me?

FYI: I am not using spring-integration but spring-messaging.

Ramsdell answered 27/10, 2015 at 18:20 Comment(0)
H
11

You can pass JmsTemplate while creating JmsMessagingTemplate

in JmsTemplate you can configure property setReceiveTimeout(long receiveTimeout) where time is in milliseconds

Hewe answered 27/10, 2015 at 18:27 Comment(1)
Thanks! That solved it. After setting receiveTimeout in JmsTemplate and then passing that to JmsMessagingTemplate it workedRamsdell
D
-1

The receive timeout can be configured in the JmsTemplate that the JmsMessagingTemplate uses.

Dope answered 27/10, 2015 at 18:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.