The timeout is not processed by Spring, it is handled in the vendor JMS library...return consumer.receive(timeout)
.
The broker "pushes" the message to the consumer when it arrives in the queue but, yes, it will take a finite time to transfer a large message and it is certainly possible for the consumer.receive()
operation to timeout (maybe repeatedly) until the message is fully transferred.
It's up to the vendor code to actually do the processing, but I would doubt any would block a receive because a message is in the process of being transferred.
So, putting a message in one queue is not a reliable way to notify that a message is available in another queue.
Consider just receiving from the real queue (or use a message-driven approach instead of the JmsTemplate).