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

Introduced auto-configuration for MultiRabbit #25369

Closed
wants to merge 1 commit into from

Conversation

rwanderc
Copy link

@rwanderc rwanderc commented Feb 19, 2021

Hi Spring Team!

This feature introduces configuration-based initialization for multiple Rabbit brokers:

  • introduces the AutoConfiguration for MultiRabbit (contributed to spring-amqp #1111 & #1303 and available at version 2.3.5);
  • and provides documentation.

Javadocs are mentioning 2.4. I wonder if that's possible to be available in that version, but I will update it if eventually that's not the release version for this feature.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 19, 2021
@wilkinsona
Copy link
Member

wilkinsona commented Feb 19, 2021

Thanks for the proposal. We have an open issue for auto-configuring multiple DataSources that is related to this. Unfortunately, I don't think we can add support for auto-configuring connections to multiple RabbitMQ brokers without considering how it will look for DataSources and other components.

You've taken a routing-based approach here that is akin to Spring Framework's AbstractRoutingDataSource. We also need to support the use case where users want multiple DataSource or ConnectionFactory beans in the context and things will need to be done in a way where one does not clash with the other.

On the DataSource side, we've seen more demand for auto-configuring multiple DataSources rather than a single AbstractRoutingDataSource and I suspect that will be the same for other backend services, including Rabbit brokers. In short, I think we'll need to do the design work for #15732 before we can consider this.

@rwanderc
Copy link
Author

Thank you @wilkinsona for the quick answer!
Regarding the intention of having a matching design between multiple DataSources and ConnectionFactories, I can clearly see the benefit.
But on the other hand, if that takes some more time (this issue #15732 is already 2 years old), blocking this feature might be less beneficial than updating the implementation later on.
Don't you think it's worth it to carry on with the routing-based approach and update it when the decision is made?

@wilkinsona
Copy link
Member

No, I'm afraid not.

If it were only a matter of updating implementation details then it wouldn't be a problem, but I think it's almost certain that things would change from a user's perspective, and probably change considerably. That would mean that we're unable to do anything until Spring Boot 3.0 as the breaking changes would be too great to include in a minor release.

The benefit of adding multi-Rabbit auto-configuration now is that it makes it easier to do something that's already possible. The cost of adding multi-Rabbit auto-configuration now is that it may make it impossible to make some other enhancements until 3.0. Unfortunately, that cost outweighs the benefit.

Thanks very much for the pull request, but I think it's best that we close this one as we won't be able to merge it in its current form. As part of tackling #15732 we can consider how things would look for other backends including RabbitMQ. Right now I'm imagining properties for configuring multiple DataSources, ConnectionFactories, etc and with an additional property to group two or more of those into a routing DataSource or ConnectionFactory. As such, everything would be configured using spring.datasource.* or spring.rabbitmq rather than introduction completely separate groups of properties.

@wilkinsona wilkinsona closed this Feb 20, 2021
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 20, 2021
humaolin pushed a commit to humaolin/spring-boot that referenced this pull request May 7, 2022
Includes synchronization for mutators on MutablePropertySources.

Closes spring-projectsgh-25369

(cherry picked from commit 01bab89)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants