Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support non-blocking receiveTimeout in AbstractPollingMessageListenerContainer [SPR-14212] #18786
AbstractPollingMessageListenerContainer#receiveMessage currently blocks indefinitely both on negative values and 0 as receiveTimeout. The documentation for receiveTimeout mentions -1, but not 0. However, MessageConsumer#receive blocks if the timeout is 0 and AbstractPollingMessageListenerContainer uses receive() or receive(timeout) - never receiveNoWait().
In some cases, for example with Oracle AQ, receiveNoWait yields better performance.
It is very simple to fix this. Simply check for 0 and call receiveNoWait. I will create a pull request.
Reference URL: #1043
Referenced from: commits 87b93a7
Juergen Hoeller commented
This is actual an unintended inconsistency: As with
Additionally, an indefinite wait is a particularly bad idea with a
So as of 4.3, I've reworded our