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) {
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;
}
}

View File

@ -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();