diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java index d5d42d8d9c..d409568290 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java @@ -202,7 +202,7 @@ public class AMQPStandardMessage extends AMQPMessage { this.modified = false; this.messageDataScanned = MessageDataScanningStatus.NOT_SCANNED.code; int estimated = Math.max(1500, data != null ? data.capacity() + 1000 : 0); - ByteBuf buffer = PooledByteBufAllocator.DEFAULT.heapBuffer(estimated); + ByteBuf buffer = PooledByteBufAllocator.DEFAULT.directBuffer(estimated); EncoderImpl encoder = TLSEncode.getEncoder(); try {