diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java index cc79c2c830..b548b29861 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java @@ -551,12 +551,16 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage { */ protected TypedProperties checkProperties() { if (properties == null) { - TypedProperties properties = new TypedProperties(); - if (buffer != null && propertiesLocation >= 0) { - final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation); - properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); + synchronized (this) { + if (properties == null) { + TypedProperties properties = new TypedProperties(); + if (buffer != null && propertiesLocation >= 0) { + final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation); + properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); + } + this.properties = properties; + } } - this.properties = properties; } return this.properties;