ARTEMIS-3553 -5718 Conversion of AMQP large message expiry
This commit is contained in:
parent
cefdc8dde4
commit
6de637259b
|
@ -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();
|
||||
|
|
|
@ -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 {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue