Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Receiving Non-Null Messages when receiving from empty SB Queue when using Java SDK

$
0
0

When retrieving messages from an SB Queue using the Java SDK, a non-null ReceiveQueueMessageResult is returned even if the Queue in question is empty. Calling getValue on that result returns a non-null BrokeredMessage. How am I supposed to tell that I’ve called receive on an empty Queue? Obviously querying size is not an option in a distributed, concurrent system.

I'm using ReceiveAndDelete Mode and the Queue is newly created so I KNOW it's empty.

According to docs, the underlying call to the API should return a StatusCode of 204. I can not find any way to access that Code in the returned Result or Message.

TIA,

Bill



Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>