Skip to content

AbstractConnectionFactory - addressShuffleMode RANDOM as default #1497

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
rvervaek opened this issue Aug 26, 2022 · 1 comment
Closed

AbstractConnectionFactory - addressShuffleMode RANDOM as default #1497

rvervaek opened this issue Aug 26, 2022 · 1 comment
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. type: enhancement

Comments

@rvervaek
Copy link

Expected Behavior

When using a RabbitMQ cluster, client applications using Spring's ConnectionFactory abstraction connect by default to the first host configured in the list of addresses provided. Using a RabbitMQ cluster provides not only fault tolerance in the case of node failures, but also resiliency when client connections are distributed among all nodes. I can't think of a single use-case where it is desired to let all client applications connect to the same node in a cluster. Therefor I would expect the default value of addressShuffleMode in AbstractConnectionFactory to be set to RANDOM so clients randomly choose a node to connect to, resulting in a somewhat even distribution of client connections among nodes in the cluster.

Current Behavior

The default addressShuffleMode is NONE, resulting in all client applications connecting to the first node defined in the addresses.

Context

In our cluster a single node handles almost all of the client connections, resulting in unnecessary load on the node. Additionally, performing an upgrade of that node or observing a crash would result in all client applications losing their connections instead of just a portion.

Happy to make a PR if this sounds feasible.

@garyrussell
Copy link
Contributor

Seems reasonable; NONE was chosen because it was added in a patch release and we can't make behavior changes until minor/major releases.

Since the upcoming 3.0 release is a major release, we can make such a change; a PR would be appreciated; we would also need a change to the doc as well as an entry in the what's new section.

Thanks.

@garyrussell garyrussell added ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. and removed status: waiting-for-triage labels Aug 26, 2022
rvervaek pushed a commit to rvervaek/spring-amqp that referenced this issue Aug 26, 2022
rvervaek pushed a commit to rvervaek/spring-amqp that referenced this issue Sep 2, 2022
rvervaek pushed a commit to rvervaek/spring-amqp that referenced this issue Sep 2, 2022
garyrussell added a commit that referenced this issue Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants