diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java index 8606429339..18608d9f4c 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java @@ -1073,7 +1073,9 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache. if (header != null && header .getDurable() != null) { return header.getDurable(); } else { - return false; + // if header == null and scanninStatus=RELOAD_PERSISTENCE, it means the message can only be durable + // even though the parsing hasn't happened yet + return getDataScanningStatus() == MessageDataScanningStatus.RELOAD_PERSISTENCE; } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/journal/AmqpJournalLoadingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/journal/AmqpJournalLoadingTest.java index f6e816628d..b3c334aa96 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/journal/AmqpJournalLoadingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/journal/AmqpJournalLoadingTest.java @@ -60,6 +60,7 @@ public class AmqpJournalLoadingTest extends AmqpClientTestSupport { Assert.assertThat(message, Matchers.instanceOf(AMQPMessage.class)); amqpMessage = (AMQPMessage) message; Assert.assertEquals(AMQPMessage.MessageDataScanningStatus.RELOAD_PERSISTENCE, amqpMessage.getDataScanningStatus()); + Assert.assertTrue(amqpMessage.isDurable()); } AmqpClient client = createAmqpClient();