ARTEMIS-3383 AMQPMessage.isDurable wrongly returns false during persistent lazy reload state

This commit is contained in:
Clebert Suconic 2021-07-12 22:58:14 -04:00
parent ec508d8306
commit ee3814dbfd
2 changed files with 4 additions and 1 deletions

View File

@ -1073,7 +1073,9 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
if (header != null && header .getDurable() != null) { if (header != null && header .getDurable() != null) {
return header.getDurable(); return header.getDurable();
} else { } 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;
} }
} }

View File

@ -60,6 +60,7 @@ public class AmqpJournalLoadingTest extends AmqpClientTestSupport {
Assert.assertThat(message, Matchers.instanceOf(AMQPMessage.class)); Assert.assertThat(message, Matchers.instanceOf(AMQPMessage.class));
amqpMessage = (AMQPMessage) message; amqpMessage = (AMQPMessage) message;
Assert.assertEquals(AMQPMessage.MessageDataScanningStatus.RELOAD_PERSISTENCE, amqpMessage.getDataScanningStatus()); Assert.assertEquals(AMQPMessage.MessageDataScanningStatus.RELOAD_PERSISTENCE, amqpMessage.getDataScanningStatus());
Assert.assertTrue(amqpMessage.isDurable());
} }
AmqpClient client = createAmqpClient(); AmqpClient client = createAmqpClient();