-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] RoutableMessageBus route to default bus #31288
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a3e17df
to
8fde9b3
Compare
505cc53
to
c15ba90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments.
if (!$this->busLocator->has($busNameStamp->getBusName())) { | ||
throw new InvalidArgumentException(sprintf('Invalid bus name "%s" on BusNameStamp.', $busNameStamp->getBusName())); | ||
if (!$this->busLocator->has($busName)) { | ||
throw new InvalidArgumentException(sprintf('Bus name "%s" does not exists.', $busName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new InvalidArgumentException(sprintf('Bus name "%s" does not exists.', $busName)); | |
throw new InvalidArgumentException(sprintf('Bus named "%s" does not exist.', $busName)); |
{ | ||
$this->expectException(InvalidArgumentException::class); | ||
$this->expectExceptionMessage('does not contain a BusNameStamp'); | ||
$this->expectExceptionMessage(sprintf('Bus name "%s" does not exists.', MessageBusInterface::class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move these to annotations instead actually? It's more readable.
6ed20d8
to
8513c4f
Compare
8513c4f
to
c4e5e83
Compare
Thank you @dirk39. |
…irk39) This PR was squashed before being merged into the 4.3-dev branch (closes #31288). Discussion ---------- [Messenger] RoutableMessageBus route to default bus | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31200 | License | MIT | Doc PR | Not needed Hi! I modified the behaviour of RoutableMessageBus to route message without BusNameStamp to default bus instead of raise an exception. Made with ❤️ by [](https://www.meetup.com/it-IT/Open-Source-Saturday-Milano/) Commits ------- c4e5e83 [Messenger] RoutableMessageBus route to default bus
Comments addressed in 2eda6ff |
This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] Fix routable message bus default bus | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | not needed In #31288, we gave the `RoutableMessageBus` a "default" bus. We did that by using the `MessageBusInterface` service in the locator. But, no such service exists - I think that was just a huge oversight (and maybe @dirk39 named a bus this in the project he was testing on?). The services in the locator are very simply the keys under `framework.messenger.buses` or the default, which is a single `messenger.bus.default` id. There is an alias in the container for `MessageBusInterface`, but this is not added to the locator (and adding it would be a bit awkward, as `MessengerPass` is in the component and the interface alias is entirely a framework thing). Cheers! Commits ------- 42e0536 Changing how RoutableMessageBus fallback bus works
Hi! I modified the behaviour of RoutableMessageBus to route message without BusNameStamp to default bus instead of raise an exception.
Made with ❤️ by