10000 [Messenger] pass the transport name to the factory · Issue #32526 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] pass the transport name to the factory #32526

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

Closed
Tobion opened this issue Jul 12, 2019 · 2 comments
Closed

[Messenger] pass the transport name to the factory #32526

Tobion opened this issue Jul 12, 2019 · 2 comments

Comments

@Tobion
Copy link
Contributor
Tobion commented Jul 12, 2019

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.

@Koc
Copy link
Contributor
Koc commented Jul 15, 2019

Can you provide config examples how you can define multiple transports now and how it would be after proposed improvement?

@Tobion
Copy link
Contributor Author
Tobion commented Jul 17, 2019

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

@fabpot fabpot closed this as completed Jul 19, 2019
fabpot added a commit that referenced this issue Jul 19, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0