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

Make socket connection to try all DNS record IPs #138

Closed
ebuildy opened this issue Mar 30, 2016 · 6 comments
Closed

Make socket connection to try all DNS record IPs #138

ebuildy opened this issue Mar 30, 2016 · 6 comments
Assignees
Milestone

Comments

@ebuildy
Copy link

ebuildy commented Mar 30, 2016

In a HA RabbitMQ cluster, I use DNS round robin technic to load balance the load between nodes and replace HAProxy, for instance:

rabbitmq => 10.0.0.1 10.0.0.2 10.0.0.3

It works like a charm with the Php extension, because here:

https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp_socket.c#L449

We can see that all IP adresses from DNS record are "tested", so if a node goes down, no problemo, no error on Php side when connecting.

But, I also use logstash to consume RabbitMQ messages, which uses this library, and apparently, this little trick is not working as I can see on:

https://github.com/rabbitmq/rabbitmq-java-client/blob/master/src/main/java/com/rabbitmq/client/impl/FrameHandlerFactory.java#L28

Do you think this could be a feature here (or I may miss a Java trick here) ?

Thanks you,

@michaelklishin michaelklishin changed the title [feature] Make socket connection to try all DNS record IPs Make socket connection to try all DNS record IPs Jun 7, 2016
@michaelklishin
Copy link
Member

It's worth investigating if this client could do a similar thing.

@acogoluegnes
Copy link
Contributor

@ebuildy Maybe this can be achieved with a custom implementation of the interface introduced in #169

@ebuildy
Copy link
Author

ebuildy commented Aug 22, 2016

Yeah ! Looks pretty good, thanks, i will work on the logstash plugin to
implement this .

Le 22 août 2016 4:56 PM, "Arnaud Cogoluègnes" notifications@github.com a
écrit :

@ebuildy https://github.com/ebuildy Maybe this can be achieved with a
custom implementation of the interface introduced in #169
#169


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#138 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABKc6W-YFQiyZZlNM7_hXI02vjuUzkOpks5qibiugaJpZM4H7gm2
.

@michaelklishin
Copy link
Member

@ebuildy to make it clear that we would be interested in making this a core feature but would like to understand how exact you would like it to work. Given that this is an interface that can have multiple implementations, the risk for us in including something in the core is quite low.

@acogoluegnes
Copy link
Contributor

@ebuildy your changes could actually be in a custom implementation of AddressResolver. That would leave the FrameHandlerFactory unchanged.

acogoluegnes added a commit that referenced this issue Aug 23, 2016
Issue #153. Could help for #104 and #138.

Conflicts:
	src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java
@michaelklishin michaelklishin added this to the 4.0.0 milestone Aug 24, 2016
acogoluegnes added a commit that referenced this issue Aug 24, 2016
acogoluegnes added a commit that referenced this issue Aug 24, 2016
acogoluegnes added a commit that referenced this issue Aug 24, 2016
For 1-hostname scenarios.

Fixes #138
acogoluegnes added a commit that referenced this issue Aug 25, 2016
acogoluegnes added a commit that referenced this issue Aug 25, 2016
acogoluegnes added a commit that referenced this issue Aug 25, 2016
Add DNS record IPs AddressResolver to stable

Fixes #138
@michaelklishin
Copy link
Member

This feature has an unfortunate side-effect: it makes peer verification (as in TLS) based on hostname comparison next to impossible to do in many environments.

We will disable this resolver by default in a future 4.x and 5.x minor releases and not use it by default as of 6.0. It's a nice feature but TLS peer verification is a lot more popular and arguably important.

stream-iori pushed a commit to stream-iori/rabbitmq-java-client that referenced this issue Mar 20, 2022
* fix LogEnvUtils java.util.ConcurrentModificationException

* fix LogEnvUtils java.util.ConcurrentModificationException

* fix LogEnvUtils java.util.ConcurrentModificationException

* fix LogEnvUtils java.util.ConcurrentModificationException

* fix LogEnvUtils java.util.ConcurrentModificationException

Co-authored-by: “HzjNeverStop” <“441627022@qq.com”>
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

3 participants