Azure Service Bus topics - message completion

David Ribeiro 87 Reputation points
2020-09-20T20:16:26.69+00:00

Hi,

Iam new at service bus, and have a requirement to have some subscribers for the same message in azure, so for me service bus with topics seems to be the way to go.

But I was wondering, what if at one of the subscribers goes wrong? How do I Know or is there a way to tell this message is not complete yet because subscriber X didn't succeed yet?

Another question on top, is there any built in way to perform retries on a subscriber?

Thanks

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

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2020-09-21T03:58:30.31+00:00

    Hi @David Ribeiro

    Yes, your understanding is correct that you need to use topic when there are multiple subscribers that want to consume the same message.
    Individual subscriber will be consuming the messages from the individual subscription of the same topic. Subscribers can define which messages they want to receive from a topic using the filter.

    When there is an exception generated at the application you can refer to different exception types that will help you to understand cause, and notes suggested action you can take. Let's say if your consumer application has peaked the messages but was not able to call Compete on that messages due to any reasons (application crash, server restarted, etc.) then once the lock expires (after lock duration) on that message then the message will be again visible for your consumer to be consumed. The brokered message delivery count property will keep on increasing for that message for every failure your client application is not able to consume that message. Once it has reached the MaxDeliveryCount the message will be deleted (if you have disabled dead lettering property of subscription) or moved to dead letter queue.

    You can update the MaxDeliveryCount property (default value 10) to your own value according to your requirement and use service bus metrics (Dead -letterd messages) to setup the alter to notify you if there is any message in the dead letter queue.

    Azure service bus SDK already has a default retry mechanism and you can refer to this article for more details.

    Note: You need to refer to expectation type to understand in which exception the inbuild retry works. If the "inbuild retry doesn't help" then you need to implement your own retry logic to retry that operation. When there is a client issue/error/code issue from client side the inbuild retry doesn't help.

    Hope the above helps and please let me know if you have any queries.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


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.