0

I need to retry a specific failed messenger message from a Symfony controller. When I try to retrieve failed messages by $this->failedTransport->get(); all messages are cleared which is not what I want. I cannot use Symfony\Component\Messenger\Transport\Failed\FailedMessageRepositoryInterface because this is a project in Symfony 3. I tried to convince my team to do it in some other way than retrying messages from a controller but they didn't like my ideas. Is it even possible to do it some way?

brnina
  • 27
  • 1
  • 4

1 Answers1

0

Usually what happens it that when you fetch messages (failed or not), all those messages are acknowleged and removed from the queue (depending on your message broker; rabbitmq/database/kafka/etc). I think you need some method to unacknowlege your messages, so they are kept in your message broker.

Another approach is you keep failed messages in a database, and create a doctrine entity for it, so now you can query it like a normal table. If you see a message that needs to be retried, you get the message id and retry it using the messagebus.

Leroy
  • 1,600
  • 13
  • 23