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

Introduce a method to create connection from multiple hosts. #562

Merged
merged 4 commits into from
Apr 23, 2018

Conversation

hairyhum
Copy link
Collaborator

@hairyhum hairyhum commented Apr 19, 2018

Add a new static method create_connection in AbstractConnection
to create a connection providing multiple hosts.

The method takes an array of host arrays
with host,port,username,password and vhost keys
and tries to connect to them one-by-one.
The first successful connection is returned.
If unable to connect to any of them - the last esception is thrown.

This method is a simplest way to address issues like #253 or #498
There is no bookkeeping and load balancing, hosts are
selected one-by-one starting from the first one.

Combined with connection recovery techniques it can be used
to improve reliability when using clusters.

@hairyhum hairyhum added this to the 2.8.0 milestone Apr 19, 2018
Add a new static method `create_connection` in `AbstractConnection`
to create a connection providing multiple hosts.

The method takes an array of host arrays
with host,port,username,password and vhost keys
and tries to connect to them one-by-one.
The first successful connection is returned.
If unable to connect to any of them - the last esception is thrown.

This method is a simplest way to address issues like #253
There is no bookkeeping and load balancing, hosts are
selected one-by-one starting from the first one.

Combined with connection recovery techniques it can be used
to improve reliability when using clusters.
Copy link
Collaborator

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

👍 @hairyhum you may want to review the small changes I made in commit 4e55d9f

@hairyhum
Copy link
Collaborator Author

@nubeiro are you happy with us merging this?

@hairyhum hairyhum merged commit 08a8174 into master Apr 23, 2018
@ramunasd ramunasd deleted the connect-to-multiple-hosts branch August 1, 2019 07:51
kratkyzobak pushed a commit to kratkyzobak/php-amqplib that referenced this pull request Feb 9, 2024
…le-hosts

Introduce a method to create connection from multiple hosts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants