ReceiveQueueMessage sometimes works sometimes not
I have implemented message queue receiving follwing the example in the documentation here https://azure.microsoft.com/en-us/documentation/articles/service-bus-java-how-to-use-queues/.
I have noticed that even if the queue contains messages, the service.receiveQueueMessage() does not get it. I have done the same test using .NET c# and it works really fine: it is fast, does not require polling.
Why the Java implementation sometime receive queue messages and sometimes not?
@jianghaolu - could you tag someone from service bus team who owns this part of SDK?
News for this issue?
Notice about "jianghaolu push" : seems github reference a commit which talk about "Merge pull request #644 from amarzavery/rf" so its pull request #644 and not this issue #644.
That commit was unrelated. The commits were from a different repo. Adding owner of the service bus library: @djrosanova
I have the same or similar problem. It works for me if I use ReceiveMode.RECEIVE_AND_DELETE, but ReceiveMode.PEEK_LOCK never returns a message.
For me, when using PEEK_LOCK, ServiceBusRestProxy received a 411 Length required from the server. I noticed my project was pulling in a later version of jersey-client than the Azure SDK specifies in its dependencies.
After changing jersey-client to 1.1.3, PEEK_LOCK works for me.
This was difficult to troubleshoot because ServiceBusRestProxy did not treat the 411 as an error condition and returns a null/empty message. (ServiceBusRestProxy has same behavior when receiving 401 if you use bad credentials). ServiceBusRestProxy should not swallow those errors.
the service bus client library is not in this repo anymore, so if this is still an issue, it should go there: https://github.com/azure/azure-service-bus-java