azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Service Bus message direct to Dead Letter with message and stack trace is missing

Open grayjeremy opened this issue 7 years ago • 2 comments

There is no method or example to send a message directly to a dead letter queue. The .net sdk has a DeadLetter method that accepts a reason and a stacktrace. If this exists, I can't find it and we need some examples or how to deal with error logic.

The case here is a malformed message that will never be able to process doesn't need to be retried 10 times. Those 10 retries can incur expense in other services and are wasteful in a consumption environment.

I should be able to create an Azure Function in python, import the azure.service bus python package and do msg.dead_letter("reason",stacktrace/additional info) and have the message go directly to the SB's dead letter queue.

grayjeremy avatar Jun 07 '19 16:06 grayjeremy

@annatisch ?

lmazuel avatar Jun 11 '19 18:06 lmazuel

Hey Gray; Sorry this fell through the cracks, but in the hope of providing some breadcrumbs, if only for others who see this thread:

There seem to be two sub-points to be touched on here, and I'll address them both.

  1. Immediate deadlettering. Per your example (msg.dead_letter) that's precisely the API we currently offer. While I'll be the first to admit in grepping around for pointers for this that we don't seem to have obvious docs for this scenario, (We're bolstering them substantially for our upcoming GA release) I'd point you at this sample for deferral here and mention that the dead lettering pattern is isomorphic, per the function defined here
  2. Dead lettering with both a description and reason parameter. We currently only support Description; This is a known bug in the underlying UAMQP implementation that we're currently addressing in that lib, and hope to have included for the final 0.50.3 release. (Final due to that the 0.* lib is being deprecated as we roll out the GA release, version 7.0.0, currently in preview. Kindly excuse the large version gap, it's to align with other MS SDKs.)

Closing this for now assuming the above should cover all our angles, but if there's any further issue/bits that need clarification, don't hesitate to reach out and/or reopen.

KieranBrantnerMagee avatar May 07 '20 22:05 KieranBrantnerMagee