Azure SDK for Java to process messages from Service Bus queue

Yuvaraj Madheswaran 390 Reputation points
2023-07-14T16:07:48.5066667+00:00

Hi,

We are using the Azure SDK for Java to process messages from Service Bus queue. We are referring the document from azure doc link,

https://learn.microsoft.com/en-us/java/api/com.azure.messaging.servicebus.servicebusreceiverasyncclient?view=azure-java-stable

As per the doc, we marked the processed message complete but its not working. The messages are not being removed from queue even after setting the status as complete. Any thoughts on this issues?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
700 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-08-09T03:26:04.4566667+00:00

    Hi @Yuvaraj Madheswaran

    I'm glad to see you were able to resolve your issue. Thanks for posting your solution so that others experiencing the same thing can easily reference this.

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Issue: You observed that when you marked the message as complete, the message is not being removed from queue even. receiver.complete(message)

    Resolve: You found that you need to use the subscribe() method on the complete call as below to resolve the issue receiver.complete(message).subscribe();

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.