diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java index a6438629ff..3e749ea082 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java @@ -40,6 +40,7 @@ public class PagedMessageImpl implements PagedMessage { private static final byte NONE = 0; private static final byte CORE = 1; + private static final byte OLD_CORE = -1; private static final byte NOT_CORE = 2; public static boolean isLargeMessage(byte encodedValue) { @@ -47,6 +48,7 @@ public class PagedMessageImpl implements PagedMessage { case LargeMessageType.NONE: return false; case LargeMessageType.CORE: + case LargeMessageType.OLD_CORE: case LargeMessageType.NOT_CORE: return true; default: @@ -59,7 +61,8 @@ public class PagedMessageImpl implements PagedMessage { } public static boolean isCoreLargeMessageType(byte encodedValue) { - return encodedValue == LargeMessageType.CORE; + return encodedValue == LargeMessageType.CORE || + encodedValue == LargeMessageType.OLD_CORE; } public static byte valueOf(Message message) { diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java index ae94083f67..a61bd3d9ea 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java @@ -110,6 +110,23 @@ public class JournalCompatibilityTest extends VersionedBase { evaluate(receiverClassloader, "meshTest/sendMessages.groovy", server, receiver, "receiveMessages"); } + @Test + public void testSendReceivePaging() throws Throwable { + setVariable(senderClassloader, "persistent", true); + startServer(serverFolder.getRoot(), senderClassloader, "journalTest", null, true); + evaluate(senderClassloader, "journalcompatibility/forcepaging.groovy"); + evaluate(senderClassloader, "meshTest/sendMessages.groovy", server, sender, "sendAckMessages"); + evaluate(senderClassloader, "journalcompatibility/ispaging.groovy"); + stopServer(senderClassloader); + + setVariable(receiverClassloader, "persistent", true); + startServer(serverFolder.getRoot(), receiverClassloader, "journalTest", null, false); + evaluate(receiverClassloader, "journalcompatibility/ispaging.groovy"); + + setVariable(receiverClassloader, "latch", null); + evaluate(receiverClassloader, "meshTest/sendMessages.groovy", server, receiver, "receiveMessages"); + } + /** * Test that the server starts properly using an old journal even though persistent size * metrics were not originaly stored