diff options
author | hakonhall <hakon@yahoo-inc.com> | 2016-10-14 11:26:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-14 11:26:02 +0200 |
commit | aec5a34fc520b066d99e3424d552031a914e26a5 (patch) | |
tree | 5b58361ee85a99f9495f8188bf69f67bc11804ba /messagebus | |
parent | 9dbec23e389de09ccd67f6ac8d87710887dae3a6 (diff) |
Revert "Revert "Use HostName for message bus, but fix HostName to work with dev machines""
Diffstat (limited to 'messagebus')
-rw-r--r-- | messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java b/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java index 45887b072ab..a10cd4b8a63 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/Identity.java @@ -1,12 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.messagebus.network; -import com.yahoo.log.LogLevel; import com.yahoo.net.HostName; -import com.yahoo.net.LinuxInetAddress; - -import java.net.Inet6Address; -import java.net.InetAddress; /** * This class encapsulates the identity of the application that uses this instance of message bus. This identity @@ -28,11 +23,7 @@ public class Identity { * @param configId The config identifier for the application. */ public Identity(String configId) { - InetAddress addr = LinuxInetAddress.getLocalHost(); // try hard to get a resolvable address - if (addr instanceof Inet6Address) // - hostname = HostName.getLocalhost(); // ... but fallback to hostname if we get an IPv6 address - else - hostname = addr.getCanonicalHostName(); + hostname = HostName.getHostName(); // ... but fallback to hostname if we get an IPv6 address servicePrefix = configId; } |