You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
We have a lot of exchanges/queues and need to create a custom transport for each one using the Symfony\Component\Messenger\Transport\TransportFactoryInterface. It would be very useful to receive the configured transport name as a parameter to \Symfony\Component\Messenger\Transport\TransportFactoryInterface::createTransport(string $dsn, array $options, SerializerInterface $serializer). We could just forward the transport name as an option which does not require a signature change.
The current solution is to manually add the transport name to the options for each transport which is prone to copy-paste errors.
The text was updated successfully, but these errors were encountered:
It allows to use the transport name as a lookup value in the factory to make decisions. For example chose a certain serializer based on the transport. It would make #31230 easier for example. Otherwise I have to add an option for this manually to each transport config. See PR #32567
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] pass transport name to factory
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | no
| New feature? | yes
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32526
| License | MIT
| Doc PR |
It's technically a new feature but so tiny I'd be happy to have it in 4.3
Commits
-------
59926c8 [Messenger] pass transport name to factory
Uh oh!
There was an error while loading. Please reload this page.
Description
We have a lot of exchanges/queues and need to create a custom transport for each one using the
Symfony\Component\Messenger\Transport\TransportFactoryInterface
. It would be very useful to receive the configured transport name as a parameter to\Symfony\Component\Messenger\Transport\TransportFactoryInterface::createTransport(string $dsn, array $options, SerializerInterface $serializer)
. We could just forward the transport name as an option which does not require a signature change.The current solution is to manually add the transport name to the options for each transport which is prone to copy-paste errors.
The text was updated successfully, but these errors were encountered: