diff --git a/activemq-core/src/main/java/org/apache/activemq/util/IdGenerator.java b/activemq-core/src/main/java/org/apache/activemq/util/IdGenerator.java index 34345665c2..049a684c11 100755 --- a/activemq-core/src/main/java/org/apache/activemq/util/IdGenerator.java +++ b/activemq-core/src/main/java/org/apache/activemq/util/IdGenerator.java @@ -56,10 +56,14 @@ public class IdGenerator { Thread.sleep(100); ss.close(); } catch (Exception ioe) { - LOG.warn("could not generate unique stub", ioe); + LOG.warn("could not generate unique stub by using DNS and binding to local port", ioe); } - } else { + } + // fallback + if (hostName == null) { hostName = "localhost"; + } + if (stub.length() == 0) { stub = "-1-" + System.currentTimeMillis() + "-"; } UNIQUE_STUB = stub;