Skip to content

Provide a property for configuring Spring AMQP's address shuffle mode #23091

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

Conversation

01045972746
Copy link
Contributor

This support connecting to RabbitMQ clustered host addresses with shuffling.
https://docs.spring.io/spring-amqp/reference/html/#cluster

Because of shuffle-addresses mode is deprecated, i have added addressShuffleMode property which is String.
Please review and comment. Thanks.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 26, 2020
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion and the PR. I've made a few comments, can you please have a look to those and also add the necessary tests to exercise the code that you've changed?

/**
* Shuffling mode for connecting host. Default mode is NONE.
*/
private String addressShuffleMode = "NONE";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum should be exposed rather as it provides better metadata

@@ -87,6 +89,11 @@
*/
private String addresses;

/**
* Shuffling mode for connecting host. Default mode is NONE.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value should not be documented as it's the role of the configuration metadata to do that (look at other keys for inspiration).

* @see #setAddressShuffleMode(String)
* @see #getAddressShuffleMode()
*/
public AbstractConnectionFactory.AddressShuffleMode determineAddressShuffleMode() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do that. Rather we should set whatever has been set by the user.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Aug 26, 2020
@01045972746 01045972746 requested a review from snicoll August 26, 2020 13:02
@01045972746
Copy link
Contributor Author

@snicoll , i have edited what you mention. please re-review plz.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 26, 2020
@snicoll snicoll closed this in cf9e85c Aug 27, 2020
@snicoll snicoll added type: enhancement A general enhancement and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Aug 27, 2020
@snicoll snicoll self-assigned this Aug 27, 2020
@snicoll snicoll added this to the 2.4.0-M3 milestone Aug 27, 2020
@snicoll
Copy link
Member

snicoll commented Aug 27, 2020

@01045972746 thank you for making your first contribution to Spring Boot. I've polished your contribution and added a test.

@wilkinsona wilkinsona changed the title Support addressShuffleMode to Spring Amqp Autoconfiguration Provide a configuration property for configuring Spring AMQP's address shuffle mode Aug 27, 2020
@wilkinsona wilkinsona changed the title Provide a configuration property for configuring Spring AMQP's address shuffle mode Provide a property for configuring Spring AMQP's address shuffle mode Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants