Determine CompositeByteBuf implementation by using ByteBufAllocator
Motivation: Currently, using a MessageAggregator in the pipeline always results in the creation of an unpooled heap CompositeByteBuf. By using the ByteBufAllocator the CompositeByteBuf will use the implementation specified by the ByteBufAllocator. Modifications: Use the ChannelHandlerContext's ByteBufAllocator to create the CompositeByteBuf for message aggregation Result: The CompositeByteBuf is now configured based on the ByteBufAllocator's settings.
This commit is contained in:
parent
8f61e4cdd6
commit
4e34d2ce6d
@ -238,7 +238,7 @@ public abstract class MessageAggregator<I, S, C extends ByteBufHolder, O extends
|
||||
}
|
||||
|
||||
// A streamed message - initialize the cumulative buffer, and wait for incoming chunks.
|
||||
CompositeByteBuf content = Unpooled.compositeBuffer(maxCumulationBufferComponents);
|
||||
CompositeByteBuf content = ctx.alloc().compositeBuffer(maxCumulationBufferComponents);
|
||||
if (m instanceof ByteBufHolder) {
|
||||
appendPartialContent(content, ((ByteBufHolder) m).content());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user