We are currently using JmsTemplate's send(Destination, messageCreator) method for sending messages to webMethods queue. However, there are times that the send method takes too long to return which we cannot afford as our timeout should only be 5 seconds. My question is how can we ensure this? It seems that JmsTemplate has no send timeout.
An option I think we have is to wait for 5 seconds response from send() method. If it elapsed to more than 5 seconds, we will consider it as fail. However, we need to ensure that the message (tried to send) sent will not be processed at all as we'll be considering this request as failed. How do we do this? Rollback? Thanks!