Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Messenger][WIP] Show how to configure multiple buses#10016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Nyholm wants to merge2 commits intosymfony:masterfromNyholm:multiple-buses

Conversation

@Nyholm
Copy link
Member

We do currently have no example configuration with the framework bundle. I think it is a good idea to show of how to use middleware's and how to define multiple buses.

This PR could be rewritten as a part of an existing page.

I know the configuration is not very different between the buses. Whensymfony/symfony#27839 andsymfony/symfony#27840 is implemented, this config will make more sense.

Lutacon reacted with thumbs up emoji
@ogizanagi
Copy link
Contributor

ogizanagi commentedJul 6, 2018
edited
Loading

I don't know if this is a hard rule for Symfony docs, but the framework integration usually is documented in the Guides section or a dedicated page, not in the Component documentation itself.
Therefore, you can already find a doc entry accessible from the "Guides" menu showing config samples & multiple buses wiring:https://symfony.com/doc/current/messenger.html#multiple-buses.
In any case, this PR would be a nice addition to the existing section. 👍

@Koc
Copy link
Contributor

Koc commentedOct 5, 2018

Please describe how to register command/event/query handlers and how to seggregate them between buses. Nobody wants handle received message from from event bus through middlewares for command bus.

@ogizanagi
Copy link
Contributor

@Koc's comment relates to#10477. Indeed this PR might be a good place for documenting it too, but not mandatory.

Appart from the mention of a returned value in a query bus, which is not possible anymore, I think this PR is ready.

- messenger.middleware.validation
messenger.bus.event:
middleware:
- messenger.middleware.allow_no_handler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In 4.2,default_middleware: allow_no_handlers must be used instead.

(https://github.com/symfony/symfony/blob/master/UPGRADE-4.2.md#frameworkbundle)

@ogizanagi
Copy link
Contributor

I've continued your work in#10689 , adding some more things (including@Koc 's comment).

You can configure these buses and their rules by using middlewares.

It might also be a good idea to separate actions from reactions by introducing
an **event bus**. The event bus could have zero or more subscribers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If we're mentioning that events have zero or more subscribers, we should probably mention that commands and queries have exactly one handler.

@Nyholm
Copy link
MemberAuthor

Thank you@magnusnordlander and@ogizanagi

@NyholmNyholm deleted the multiple-buses branchDecember 27, 2018 21:38
@hoebelix
Copy link

Inhttps://symfony.com/doc/master/messenger/multiple_buses.html there is no example for a routing configuration for multiple buses. It would be nice if there was a typical example configuration, something like:
Route all messages of messenger.bus.events to a amqp transport, handle all messages of messenger.bus.commands synchronously.

Koc reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@magnusnordlandermagnusnordlandermagnusnordlander left review comments

@ogizanagiogizanagiogizanagi left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@Nyholm@ogizanagi@Koc@hoebelix@magnusnordlander@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp