You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/12/08 11:43:06 UTC

svn commit: r1211814 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java

Author: davsclaus
Date: Thu Dec  8 10:43:05 2011
New Revision: 1211814

URL: http://svn.apache.org/viewvc?rev=1211814&view=rev
Log:
CAMEL-4752: Updated the AMQ uid generator with code changes in AMQ source.

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  8 10:43:05 2011
@@ -1 +1 @@
-/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210771,1210830,1211363,1211414,1211773
+/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210771,1210830,1211363,1211414,1211773,1211811

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java?rev=1211814&r1=1211813&r2=1211814&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java Thu Dec  8 10:43:05 2011
@@ -21,6 +21,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.camel.spi.UuidGenerator;
 import org.apache.camel.util.InetAddressUtil;
+import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,10 +62,16 @@ public class ActiveMQUuidGenerator imple
                 Thread.sleep(100);
                 ss.close();
             } catch (Exception ioe) {
-                LOG.warn("Cannot generate unique stub", ioe);
+                LOG.warn("Could not generate unique stub by using DNS and binding to local port, will fallback and use localhost as name", ioe);
             }
-        } else {
+        }
+
+        // fallback to use localhost
+        if (hostName == null) {
             hostName = "localhost";
+        }
+
+        if (ObjectHelper.isEmpty(stub)) {
             stub = "-1-" + System.currentTimeMillis() + "-";
         }
         UNIQUE_STUB = stub;