Using second-level retries in Rebus (https://github.com/rebus-org/Rebus/wiki/Automatic-retries-and-error-handling) I need to forward a message to an error queue after n retries.
This works:
_bus.Advanced.Routing.Send("my-queue.error",failedMessage.Message, failedMessage.Message);
But the exceptions accumulated in the failed message is not brought along, making the failed message in the error queue rather useless.
Ideally I would hook into the ITransport
instance, and do something like this
await _transport.Send(errorQueueAddress, transportMessage, transactionContext);
(from PoisonQueueErrorHandler
: https://github.com/rebus-org/Rebus/blob/333dbedf486acb92bd6c6250755537032c6215fd/Rebus/Retry/PoisonQueues/PoisonQueueErrorHandler.cs)
But there is no apparent way to get to that instance.
Any ideas on how to achieve this?