diff --git a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java index 1e86bf934c..07599fef8a 100644 --- a/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java +++ b/activemq-server/src/main/java/org/apache/activemq/core/persistence/impl/journal/JournalStorageManager.java @@ -115,6 +115,7 @@ import org.apache.activemq.utils.ByteUtil; import org.apache.activemq.utils.DataConstants; import org.apache.activemq.utils.ExecutorFactory; import org.apache.activemq.utils.ActiveMQThreadFactory; +import org.apache.activemq.utils.UUID; import org.apache.activemq.utils.XidCodecSupport; import static org.apache.activemq.core.persistence.impl.journal.JournalRecordIds.ACKNOWLEDGE_CURSOR; @@ -3489,9 +3490,42 @@ public class JournalStorageManager implements StorageManager // SimpleString simpleStr = new SimpleString(duplID); // return "DuplicateIDEncoding [address=" + address + ", duplID=" + simpleStr + "]"; - return "DuplicateIDEncoding [address=" + address + ", duplID=" + ByteUtil.bytesToHex(duplID, 2) + "]"; - } + String bridgeRepresentation = null; + // The bridge will generate IDs on these terms: + // This will make them easier to read + if (address.toString().startsWith("BRIDGE") && duplID.length == 24) + { + try + { + ByteBuffer buff = ByteBuffer.wrap(duplID); + + // 16 for UUID + byte[] bytesUUID = new byte[16]; + + buff.get(bytesUUID); + + UUID uuid = new UUID(UUID.TYPE_TIME_BASED, bytesUUID); + + long id = buff.getLong(); + bridgeRepresentation = "nodeUUID=" + uuid.toString() + " messageID=" + id; + } + catch (Throwable ignored) + { + bridgeRepresentation = null; + } + } + + if (bridgeRepresentation != null) + { + return "DuplicateIDEncoding [address=" + address + ", duplID=" + ByteUtil.bytesToHex(duplID, 2) + " / " + + bridgeRepresentation + "]"; + } + else + { + return "DuplicateIDEncoding [address=" + address + ", duplID=" + ByteUtil.bytesToHex(duplID, 2) + "]"; + } + } } /**