Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] messenger:consume offers sync transports to consume from and then immediately throws an exception #51556

Copy link
Copy link
Closed
@dkarlovi

Description

@dkarlovi
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.