1

I have an application which sends the messages to the azure service bus queue. I also have another application which reads the messages from this queue and processes then sends the processed message to topic.
I see most of my messages are moving to dlq. When I see the exception in azure service bus Explorer I see that it throws the same exception for all messages - maximum retry count exceeded.. I want to know the actual exception because of which the message moved to dlq.
Where can I find this exception details? I believe that this exception details might be getting stored anywhere?

Amit
  • 167
  • 1
  • 2
  • 14
  • Do you mean that you see ``maximum retry count exceeded`` from **Message Custom Properties** of DLQ message in Service Bus Explorer? Could you see detailed description in *DeadLetterErrorDescription* property? Besides, please check "[How do messages get into the DLQ?](https://github.com/Azure/azure-service-bus/blob/master/samples/DotNet/Microsoft.ServiceBus.Messaging/DeadletterQueue/README.md)" – Fei Han May 31 '17 at 07:45
  • I have also checked the deadlettererrordecription it says message could not be consumed after 10 delivery attempts.. But when I Debug this dead letter message it throws some other exception which is because of some master data related.. That information I wanted.. – Amit May 31 '17 at 13:49
  • Hey Fred! I need to know the exception information when application level dead lettering happens.. Where this information is captured ? Can you help me with this ? – Amit May 31 '17 at 20:36

1 Answers1

1

the deadlettererrordecription it says message could not be consumed after 10 delivery attempts.

If the message exceeds MaxDeliveryCount (the default value is 10), which will be moved to the DLQ. If you read the "How do messages get into the DLQ?" that I provided in comment, you would find the below information under “Exceeding MaxDeliveryCount”.

Whenever a message has been delivered under a lock (ReceiveMode.PeekLock), but has been either explicitly abandoned or the lock has expired, the message's BrokeredMessage.DeliveryCount is incremented. When the DeliveryCount exceeds the MaxDeliveryCount, the message gets moved to the DLQ

Please check the Lock duration and make sure your client app can consume the message within the lock time-out interval. Besides, if possible, you could set a large number for MaxDeliveryCount.

enter image description here

Fei Han
  • 26,415
  • 1
  • 30
  • 41
  • Note: normally we check and process messages both in queue and DLQ to guarantee messages delivery. – Fei Han Jun 01 '17 at 02:49
  • Thank you for the information provided. I have gone through the article. But I am still not sure where the application level deadletter exceptions are captured.. Are they really captured or when the application throws the exception it retries 10 times then it throws maxdeliverycount exception.. I just want to know whether the exceptions thrown by the application are captured or not. If yes then how can we access them? – Amit Jun 03 '17 at 19:59
  • Please try to capture exception in try-catch block ``try { //process message } catch (Exception expt) { Exception ex = expt; //log exception and delivery count Console.WriteLine(String.Format("Message DeliveryCount: {0}; Exception: {1}", message.DeliveryCount.ToString(), ex.Message)); }`` – Fei Han Jun 06 '17 at 02:30