eclipse-paho / eclipse-paho/paho.mqtt.java

Improve the handling of multiple IP addresses when returned in a DNS Lookup

Open
#475 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

This is not a bug (but I think it applies to all current branches).

When the client connects to a server, under the covers a DNS lookup is performed. At the moment if multiple IP addresses are returned, the client will attempt to connect to just one.

If we cannot connect to that address, if the other addresses were attempted in turn as well then the client would be more fault tolerant of a server with multiple IP addresses.

One subtlety is the interaction of this feature with the HA feature. I propose that if two server names are provided, each of which resolves to multiple IP addresses then all the addresses of server1 would be attempted before attempting to connect to server2.

Here are a couple of links I have found describing handling connections to multiple IP addresses:
https://bugs.openjdk.java.net/browse/JDK-8051854
https://stackoverflow.com/questions/4648803/java-outgoing-tcp-connection-failover-based-on-multiple-dns-results

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.