0
votes

I am working on Azure ServiceBus Topic-Subscriptions. I created one topic and two subscriptions in Service Bus Namespace. In my current application, I am able to send messages to topic after that I receive messages by using subscribers.

But whenever one subscriber will read messages from topic then the messages are gone into Dead-Letter-Queue. That’s why second subscriber will be unable to read messages from topic.

I wrote this line in my code after process message from Topic

await subscriptionClient.CompleteAsync(message.SystemProperties.LockToken);

I followed this documentation for implementing above scenario.

So, can anyone suggest me how to read messages from topic using multiple subscribers at a time.

1

1 Answers

0
votes

whenever one subscriber will read messages from topic then the messages are gone into Dead-Letter-Queue. That’s why second subscriber will be unable to read messages from topic.

Either there's a processing logic error and message is retried until it gets moved to the dead-letter queue or you've got MaxDeliveryCount set to one processing attempt. Either way, check DeadLetterReason and DeadLetterErrorDescription headers/properties for the reason message got moved into dead-letter queue.

can anyone suggest me how to read messages from topic using multiple subscribers at a time.

Azure Service Bus supports competing consumer pattern, you don't have to do anything special.