Description
Description:
When using the symfony/messenger
component with several buses (5-6 buses, each of them with its own transports) is difficult to make the FailedMessagesRetryCommand
works correctly since its constructor force the injection of an specific message bus causing that much of the messages can't be retried since they're mapped in another bus.
Proposal
To be able to use the FailedMessagesRetryCommand with several buses, we need to:
- Replace the
MessageBusInterface
for aRoutableMessageBus
(to allow select the correct message bus inside the command, like theConsumeMessagesCommand
) - Add the
--bus
option on the available definitions to theFailedMessagesRetryCommand
class FailedMessagesRetryCommand extends AbstractFailedMessagesCommand implements SignalableCommandInterface {
...
public function __construct(
...
private RoutableMessageBus $routableBus,
...
) {
...
}
...
Then the $routbleBus->getMessageBus($busName)
should return the correct message bus to be injected in the Worker
constructor where to route the message we want to retry.
PD: I'm using the
symfony/messenger
component as standalone component outside a symfony application so it would be nice to add this feature
I'm also available to prepare the PR in case the maintainers accept the proposal.
Example
No response