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

[FEATURE REQ] Support DLQ reason and description in spring-cloud-azure-stream-binder-servicebus

Open Sheldoras opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When using spring-cloud-azure-stream-binder-servicebus I'd like to have a possibility to set a DLQ reason and description when requeuing messages into the DLQ (as it is possible when using the Azure Service Bus SDK).

Looking at the source code it seems that initially the value for DLQ reason and description is a static value / derived from the exception cause (if available).

However when following that logic along one call further, the information about DLQ reason and description is dropped/unused and thus gets lost for all subsequent logic, resulting in no DLQ reason or description ever being set when an exception causes a message to be requeued in the DLQ.

Describe the solution you'd like I would like to see the cause of any exception causing a message to be requeued in the DLQ to be reflected in the deadLetterErrorDescription - as it appears to be intended in the code in the first place.

The messageContext on which deadLetter is being called here also offers an overload which accepts DeadLetterOptions. So in general it seems possible to pass these values along, it just isn't being done right now.

Describe alternatives you've considered Alternatively I would be interested in the reasoning as to why deadLetterErrorDescription and deadLetterReason are simply 'dropped' and not processed any further in the current implementation.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Description Added
  • [x] Expected solution specified

Sheldoras avatar Jul 01 '24 15:07 Sheldoras