You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you find idea of making String RepublishMessageRecoverer.prefixedOriginalRoutingKey protected instead of private?
It would make if possible to override prefixedOriginalRoutingKey to send back with different routing key depending on message.
My case is I would like to add custom headers to message that is moved to DLQ (x-dead-letter-exchange) that is associated with a queue.
RejectAndDontRequeueRecoverer would be fine, but I can't add custom headers there.
RepublishMessageRecoverer is good for headers, but it sends back to wrong exchange - I would like to make it behave the same as RejectAndDontRequeueRecoverer about used DLQ/exchange.
Now I will have to override whole recover() with copy paste and write custom private prefixedOriginalRoutingKey.
If prefixedOriginalRoutingKey were protected, it would be sufficient to override it without necessity of copy-paste recover() and other private methods used by it.
Regarding what @garyrussellwrote but making that method protected won't change the exchange - you can set the errorExchangeName for that (also errorRoutingKey and then the prefix won't be used).
It seems to me that I can't get what I need with errorExchangeName or errorRoutingKey - they are static and I need to compute DLQ dynamically. If it do is possible, please show how could I implement it.
Thanks and Regards.
The text was updated successfully, but these errors were encountered:
garyrussell
changed the title
Make RepublishMessageRecoverer.prefixedOriginalRoutingKey protected instead of private
Improve Extensibility of RepublishMessageRecoverer
Nov 22, 2022
Enhancement
Hello,
How do you find idea of making String RepublishMessageRecoverer.prefixedOriginalRoutingKey protected instead of private?
It would make if possible to override prefixedOriginalRoutingKey to send back with different routing key depending on message.
My case is I would like to add custom headers to message that is moved to DLQ (x-dead-letter-exchange) that is associated with a queue.
RejectAndDontRequeueRecoverer would be fine, but I can't add custom headers there.
RepublishMessageRecoverer is good for headers, but it sends back to wrong exchange - I would like to make it behave the same as RejectAndDontRequeueRecoverer about used DLQ/exchange.
Now I will have to override whole recover() with copy paste and write custom private prefixedOriginalRoutingKey.
If prefixedOriginalRoutingKey were protected, it would be sufficient to override it without necessity of copy-paste recover() and other private methods used by it.
I would like to:
Regarding what @garyrussell wrote
but making that method protected won't change the exchange - you can set the errorExchangeName for that (also errorRoutingKey and then the prefix won't be used).
It seems to me that I can't get what I need with errorExchangeName or errorRoutingKey - they are static and I need to compute DLQ dynamically. If it do is possible, please show how could I implement it.
Thanks and Regards.
The text was updated successfully, but these errors were encountered: