2
votes

When retrieving messages from an SB Queue using the Java SDK (0.4.1), 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.

1
I've found the response header buried the MessageHeaders (responses) in an anonymous inner class of type DelegateHttpsURLConnection in the BrokeredMessage. Sure enough there's a 204 in there. No way to get to it (that I can find) via the interface on BrokeredMessage. - WillD

1 Answers

1
votes

We have recorded this issue, we are working on a fix now. By the way, Windows Azure SDK for Java is open source, you can even submit your own fix if you are willing to giveup the copyright to MSFT. The source code can be found https://github.com/WindowsAzure/azure-sdk-for-java