2

What the maximum accepted length of the DeadLetterErrorDescriptio?

Relating to C# QueueClient.DeadLetterAsync https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.queueclient.deadletterasync?view=azure-dotnet#Microsoft_Azure_ServiceBus_QueueClient_DeadLetterAsync_System_String_System_String_System_String_

Based on this forum, not much detail, suggests its 2^15-1 ie 32,767 https://social.msdn.microsoft.com/Forums/en-US/653ac222-42d3-4ace-8425-3349f44ef001/exception-during-messagecomplete?forum=servbus

Or is this part of the message maximum package size being 256KB (basic default service bus queue)?

Maze
  • 401
  • 2
  • 8
  • 18
  • Overall headers size should not exceed 64KB and share the maximum message size of 256KB/1MB. I'm wondering what information are you trying to assign to the `DeadLetterErrorDescription`. Usually, it's an exception message or a code, shouldn't be used as a log with a full stack trace and what not. – Sean Feldman Oct 15 '19 at 19:56

2 Answers2

3

The maximum is 4096 characters.

You can slice the string to ensure you never exceed this limit. Found this from exceeding that limit and getting an exception clearly stating the limit of 4096.

var errorDesc = error.Length > 4096 ? error.Substring(0, 4096) : text;

BrutalDev
  • 6,181
  • 6
  • 58
  • 72
0

Azure Service Bus queues and topic subscriptions provide a secondary sub-queue, called a dead-letter queue (DLQ) which is just another queue i assume. Since the purpose of the dead-letter queue is to hold messages that cannot be delivered to any receiver, or messages that could not be processed so it should be exactly like just another queue.

Please note that for Standard queue, size is 256 KB and for premium it's 1MB.

Due to system overhead, this limit is less than these values.

Maximum header size: 64 KB.

Additional reference:

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quotas

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27