Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.5.0
-
None
Description
As of QPIDJMS-92, if the consumer has been configured to have no prefetch, the client will issue and drain a single credit before inspecting its local message queue, ensuring that any available message sent by a broker will be returned to the application. However, if the client has prefetch, the consumer credit is granted and never drained, which means that a recieveNoWait call will only return a message if first given time to prefetch it, otherwise returning null even where messages 'are available'.
The behaviour should be updated such that if no message is locally available when checked, the credit is drained to ensure messages available on the broker are retrieved and given the chance to be returned rather than returning null.
The same improvement can be applied to receive with a timeout to give behaviour many would expect where messages 'are available', though it might additionally be useful if the drain could be disabled in this case.