Closed
Description
Symfony version(s) affected
6.3.3
Description
When running messenger:consume
without a transport, it asks to select which transport to consume from.
$ bin/console messenger:consume
Which transports/receivers do you want to consume?
Choose which receivers you want to consume messages from in order of priority.
Hint: to consume from multiple, use a list of their names, e.g. async, default
Select receivers to consume: [async]:
[0] async
[1] default
But, if I select default
(which is sync), it immediately throws
In SyncTransport.php line 37:
You cannot receive messages from the Messenger SyncTransport.
making this choice superfluous because the only possible selection is async
.
How to reproduce
See above.
Possible Solution
Filter out sync transports and, if only one item remains, consume that immediately.
Additional Context
I guess this could be considered an UX bug.