Repository: activemq-artemis Updated Branches: refs/heads/master 150f67f86 -> 64b455328
ARTEMIS-1052 Fixing MessageJournalTest::testStoreAMQP Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/64b45532 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/64b45532 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/64b45532 Branch: refs/heads/master Commit: 64b4553284e46ad588756fbec8e0d9024a7aa215 Parents: 150f67f Author: Clebert Suconic <[email protected]> Authored: Mon Mar 20 21:50:53 2017 -0400 Committer: Clebert Suconic <[email protected]> Committed: Mon Mar 20 21:50:57 2017 -0400 ---------------------------------------------------------------------- .../artemis/protocol/amqp/broker/AMQPMessage.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/64b45532/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java index e01d430..7de9577 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java @@ -99,6 +99,7 @@ public class AMQPMessage extends RefCountMessage { public AMQPMessage(long messageFormat, Message message) { this.messageFormat = messageFormat; this.protonMessage = (MessageImpl) message; + this.bufferValid = false; } @@ -816,12 +817,10 @@ public class AMQPMessage extends RefCountMessage { @Override public void reencode() { - parseHeaders(); - ApplicationProperties properties = getApplicationProperties(); - getProtonMessage().setDeliveryAnnotations(_deliveryAnnotations); - getProtonMessage().setMessageAnnotations(_messageAnnotations); - getProtonMessage().setApplicationProperties(properties); - getProtonMessage().setProperties(this._properties); + if (_deliveryAnnotations != null) getProtonMessage().setDeliveryAnnotations(_deliveryAnnotations); + if (_messageAnnotations != null) getProtonMessage().setMessageAnnotations(_messageAnnotations); + if (applicationProperties != null) getProtonMessage().setApplicationProperties(applicationProperties); + if (_properties != null) getProtonMessage().setProperties(this._properties); bufferValid = false; checkBuffer(); } @@ -955,6 +954,7 @@ public class AMQPMessage extends RefCountMessage { @Override public int getPersistSize() { + checkBuffer(); return DataConstants.SIZE_INT + internalPersistSize(); }
