This commit is contained in:
Clebert Suconic 2020-12-14 15:52:35 -05:00
commit f8ead97540
3 changed files with 14 additions and 2 deletions

View File

@ -141,6 +141,7 @@ public class AMQPLargeMessage extends AMQPMessage implements LargeServerMessage
largeBody = new LargeBody(this, copy.largeBody.getStorageManager(), fileCopy); largeBody = new LargeBody(this, copy.largeBody.getStorageManager(), fileCopy);
largeBody.setBodySize(copy.largeBody.getStoredBodySize()); largeBody.setBodySize(copy.largeBody.getStoredBodySize());
this.storageManager = copy.largeBody.getStorageManager(); this.storageManager = copy.largeBody.getStorageManager();
this.reencoded = copy.reencoded;
setMessageID(newID); setMessageID(newID);
} }

View File

@ -229,6 +229,17 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
protected AMQPMessage(AMQPMessage copy) { protected AMQPMessage(AMQPMessage copy) {
this(copy.messageFormat, copy.extraProperties, copy.coreMessageObjectPools); this(copy.messageFormat, copy.extraProperties, copy.coreMessageObjectPools);
this.headerPosition = copy.headerPosition;
this.encodedHeaderSize = copy.encodedHeaderSize;
this.deliveryAnnotationsPosition = copy.deliveryAnnotationsPosition;
this.encodedDeliveryAnnotationsSize = copy.encodedDeliveryAnnotationsSize;
this.messageAnnotationsPosition = copy.messageAnnotationsPosition;
this.propertiesPosition = copy.propertiesPosition;
this.applicationPropertiesPosition = copy.applicationPropertiesPosition;
this.remainingBodyPosition = copy.remainingBodyPosition;
this.applicationProperties = copy.applicationProperties;
this.messageDataScanned = copy.messageDataScanned;
} }
protected AMQPMessage(long messageFormat) { protected AMQPMessage(long messageFormat) {
@ -469,6 +480,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
} }
protected ApplicationProperties lazyDecodeApplicationProperties() { protected ApplicationProperties lazyDecodeApplicationProperties() {
ensureMessageDataScanned();
if (applicationProperties != null || applicationPropertiesPosition == VALUE_NOT_PRESENT) { if (applicationProperties != null || applicationPropertiesPosition == VALUE_NOT_PRESENT) {
return applicationProperties; return applicationProperties;
} }

View File

@ -713,8 +713,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
final Queue queueViewAfterRestart = getProxyToQueue(getQueueName()); final Queue queueViewAfterRestart = getProxyToQueue(getQueueName());
Wait.assertEquals(2, queueViewAfterRestart::getMessageCount); Wait.assertEquals(2, queueViewAfterRestart::getMessageCount);
Wait.assertTrue(server::isActive);
Thread.sleep(1000);
linkedListIterator = queueViewAfterRestart.iterator(); linkedListIterator = queueViewAfterRestart.iterator();
count = 0; count = 0;