Description
Description
Hi!
In Symfony\Component\Messenger\EventListener\SendFailedMessageForRetryListener
exists following lines:
// re-send the message for retry
$this->getSenderForTransport($event->getReceiverName())->send($retryEnvelope);
$this->eventDispatcher?->dispatch(new WorkerMessageRetriedEvent($retryEnvelope, $event->getReceiverName()));
Why it's not passing newly created envelope in transport with new stamps to the event WorkerMessageRetriedEvent
?
I mean:
// re-send the message for retry
$newEnvelope = $this->getSenderForTransport($event->getReceiverName())->send($retryEnvelope);
$this->eventDispatcher?->dispatch(new WorkerMessageRetriedEvent($newEnvelope, $event->getReceiverName()));
This leads to issue that this WorkerMessageRetriedEvent
not know any data about inserted row to DB as $retryEnvelope
is outdated after send()
call. I need to get TransportMessageIdStamp
by Doctrine for new inserted id, it stores in Envelope that returns by send, but current version not passing it further. It's impossible to do it in clear way here. Also if I have custom transport that adds some custom stamps that expected to be handled in this WorkerMessageRetriedEvent
, it's is not possible currently.
Do you have any suggestions? And is current implementation 100% correct and it's not planning to change this place?
Example
No response