Skip to content

Commit

Permalink
Use fully qualified hostname as default to advertise brokers (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Feb 7, 2020
1 parent 44dd412 commit 4018d0b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public static String getDefaultOrConfiguredAddress(String configuredAddress) {

public static String unsafeLocalhostResolve() {
try {
return InetAddress.getLocalHost().getHostName();
// Get the fully qualified hostname
return InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException ex) {
LOG.error(ex.getMessage(), ex);
throw new IllegalStateException("Failed to resolve localhost name.", ex);
Expand Down

0 comments on commit 4018d0b

Please sign in to comment.