Reputation: 452
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)?
Upvotes: 2
Views: 1506
Reputation: 6301
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;
Upvotes: 3
Reputation: 5294
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.
Upvotes: 0