Topic Consumer Unavailable: Avoid Dead Letter Queue

raminder chima 1 Reputation point
2022-02-24T12:01:26.797+00:00

Hi,

I am using Service Bus Topic Subscription to consume messages from the topic queue. Currently there is one consumer and the count will increase in near future. I am observing that if a consumer is unavailable to receive messages, all the messages are moved into Dead letter Queue. My question is that is there any way I can stop these messages moving to DLQ id the consumer goes down? In case of no consumer available, want to keep messages in queue.
What will happen in case of multiple consumers ? Would the unavailable consumer miss the delivery in that case.

Thanks for help in advance.

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,451 Reputation points
    2022-02-25T09:34:41.597+00:00

    @raminder chima Thanks for reaching out. The messages will only be moved to the dead letter queue only on these scenarios as mentioned here.
    If you observe that the consumer is not available and still the message are moving the dead letter queue then one of the reasons would be either you have set the time to live property while sending the message or set the default time to live property at the entity level i.e. queue/subscription.

    In case if your consumer doesn't consume the message within the TTL then the messages are moved to the dead letter queue if you have enabled the "dead letter on message expiration" property.
    I will suggest you to use service bus explorer to know the reason why the messages were moved to the dead letter queue.

    If the root cause of messages moving to the dead letter queue is TTLExpiredException then I will suggest you to increase the value to the max supported value as per the SKU or as per your requirement. For more details on message expiry, you can refer to this document.

    Multiple consumers will not have any impact and the suggestion would first know the root cause why the messages were moved to the dead letter queue at the first place. As mentioned, you can use service bus explorer to peek the message from the dead letter queue and the message property will have the reason details.

    0 comments No comments

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.