ARTEMIS-3553 -5718 Conversion of AMQP large message expiry

This commit is contained in:
Clebert Suconic 2021-11-03 21:07:47 -04:00
parent cefdc8dde4
commit 6de637259b
2 changed files with 14 additions and 3 deletions

View File

@ -70,6 +70,9 @@ public class AMQPLargeMessage extends AMQPMessage implements LargeServerMessage
reader.readInto(wrapbuffer);
AMQPStandardMessage standardMessage = new AMQPStandardMessage(messageFormat, buffer, extraProperties, coreMessageObjectPools);
if (this.getExpiration() > 0) {
standardMessage.reloadExpiration(this.getExpiration());
}
standardMessage.setMessageAnnotations(messageAnnotations);
standardMessage.setMessageID(messageID);
return standardMessage.toCore();

View File

@ -643,6 +643,17 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
server.start();
}
final Queue serverQueue = server.locateQueue(getQueueName());
try (LinkedListIterator<MessageReference> referenceIterator = serverQueue.iterator()) {
while (referenceIterator.hasNext()) {
MessageReference ref = referenceIterator.next();
Assert.assertEquals(ref.getMessage().getExpiration(), ref.getMessage().toCore().getExpiration());
Assert.assertTrue(ref.getMessage().getExpiration() > 0);
Assert.assertTrue(ref.getMessage().toCore().getExpiration() > 0);
}
}
final Queue dlqView = getProxyToQueue(getDeadLetterAddress());
Wait.assertEquals(2, dlqView::getMessageCount);
@ -729,7 +740,4 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
}
}