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) + "]"; + } + } } /** diff --git a/docs/user-manual/en/configuration-index.md b/docs/user-manual/en/configuration-index.md index b083eec637..5991446d77 100644 --- a/docs/user-manual/en/configuration-index.md +++ b/docs/user-manual/en/configuration-index.md @@ -48,7 +48,7 @@ Name | Description [jmx-management-enabled](management.md "30.2.1. Configuring JMX") | true means that the management API is available via JMX. Default=true [journal-buffer-size](persistence.md) | The size of the internal buffer on the journal in KB. Default=490 KiB [journal-buffer-timeout](persistence.md) | The Flush timeout for the journal buffer -[journal-compact-min-files](persistence.md) | The minimal number of data files before we can start compacting. Default=10 +[journal-compact-min-files](persistence.md) | The minimal number of data files before we can start compacting. Setting this to 0 means compacting is disabled. Default=10 [journal-compact-percentage](persistence.md) | The percentage of live data on which we consider compacting the journal. Default=30 [journal-directory](persistence.md) | the directory to store the journal files in. Default=data/journal [journal-file-size](persistence.md) | the size (in bytes) of each journal file. Default=10485760 (10 MB) diff --git a/docs/user-manual/en/persistence.md b/docs/user-manual/en/persistence.md index dff1bb0db6..bf6bf011e4 100644 --- a/docs/user-manual/en/persistence.md +++ b/docs/user-manual/en/persistence.md @@ -269,6 +269,11 @@ The message journal is configured using the following attributes in journal. The compacting algorithm won't start until you have at least `journal-compact-min-files` + Setting this to 0 will disable the feature to compact completely. + This could be dangerous though as the journal could grow indefinitely. + Use it wisely! + + The default for this parameter is `10` - `journal-compact-percentage` diff --git a/etc/IDEA-style.jar b/etc/IDEA-style.jar index d3bd12209b..431a9d9545 100644 Binary files a/etc/IDEA-style.jar and b/etc/IDEA-style.jar differ diff --git a/tests/extra-tests/pom.xml b/tests/extra-tests/pom.xml index c6c5bf04fa..4f8647d4ab 100644 --- a/tests/extra-tests/pom.xml +++ b/tests/extra-tests/pom.xml @@ -25,7 +25,7 @@ org.apache.activemq.tests activemq-tests-pom - 6.0.1-SNAPSHOT + 10.0.0-SNAPSHOT extra-tests