azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

ReceiveQueueMessage sometimes works sometimes not

Open speedy78 opened this issue 10 years ago • 7 comments

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?

speedy78 avatar Apr 05 '16 12:04 speedy78

@jianghaolu - could you tag someone from service bus team who owns this part of SDK?

anuchandy avatar Apr 06 '16 19:04 anuchandy

News for this issue?

speedy78 avatar Apr 18 '16 14:04 speedy78

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.

boly38 avatar May 04 '16 14:05 boly38

That commit was unrelated. The commits were from a different repo. Adding owner of the service bus library: @djrosanova

jianghaolu avatar May 09 '16 16:05 jianghaolu

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.

shendrix avatar May 19 '16 21:05 shendrix

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.

shendrix avatar May 20 '16 15:05 shendrix

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

alvadb avatar Jul 25 '17 20:07 alvadb