Author: davsclaus
Date: Thu Dec  8 10:47:35 2011
New Revision: 1211818

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

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

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  8 10:47:35 2011
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774
-/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773
+/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814
+/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811

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

Modified: 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java?rev=1211818&r1=1211817&r2=1211818&view=diff
==============================================================================
--- 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java
 (original)
+++ 
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/impl/ActiveMQUuidGenerator.java
 Thu Dec  8 10:47:35 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;


Reply via email to