Skip to content
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

Factories created by LocalizedQueueConnectionFactory do not inherit customizations applied to defaultConnectionFactory #1384

Open
vkochnev opened this issue Nov 3, 2021 · 2 comments

Comments

@vkochnev
Copy link

vkochnev commented Nov 3, 2021

Affects Version(s): 2.3.11

ConnectionFactory created by Spring Boot can be customized in several ways, ConnectionFactoryCustomizers, ConnectionNameStrategy to name a few. Also there is at least one post processor RabbitConnectionFactoryMetricsPostProcessor enabling metrics.

Code creating connection factories inside of LocalizedQueueConnectionFactory uses minimal configuration effectively ignoring all the customizations.
This issue might be considered to span across Spring Amqp, Spring Boot and Spring Cloud Stream projects.

I believe it can be solved with introduction of ConnectionFactoryBuilder bean (something similar to RestTemplateBuilder) which will produce connection factories customized in similar fashion, so LocalizedQueueConnectionFactory will be able to reuse it.
Or maybe there might be another approach I don't see.

@garyrussell
Copy link
Contributor

LocalizedQueueConnectionFactory.createConnectionFactory() is protected for this reason; you can subclass, override that method, call it, and further modify the factory.

Is there something else that a builder would provide?

@garyrussell garyrussell modified the milestones: 2.4.0, Backlog Nov 9, 2021
@vkochnev
Copy link
Author

Builder can provide the single source of truth for factory configuration. I do can extend LocalizedQueueConnectionFactory, but for me personally there are several difficulties:

What implemented in Spring Cloud Stream doesn't work actually, I can file an issue to Spring Cloud Stream Rabbit Binder for example (I linked one minor issue already), but I feel that solution should be more comprehensive.

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

2 participants