Skip to content

Commit ab48f63

Browse files
committed
Minor edit
1 parent 337d04f commit ab48f63

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/com/rabbitmq/client/impl/NettyFrameHandlerFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,12 @@ private void doWriteFrame(Frame frame) throws IOException {
394394
end.writeByte(AMQP.FRAME_END);
395395

396396
ByteBuf composite = Unpooled.wrappedBuffer(header, body, end);
397-
this.channel.writeAndFlush(composite);
397+
// this is for basicPublish, the channel will be flushed later
398+
this.channel.write(composite, this.channel.voidPromise());
398399
} else {
399400
ByteBuf bb = this.channel.alloc().buffer(frame.size());
400401
frame.writeToByteBuf(bb);
401-
this.channel.writeAndFlush(bb);
402+
this.channel.writeAndFlush(bb, this.channel.voidPromise());
402403
}
403404
}
404405

src/test/java/com/rabbitmq/client/test/PublishWithByteBufferTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected void releaseResources() throws IOException {
4848
}
4949

5050
@Test
51-
public void basicConsumeDeliverCancel() throws Exception {
51+
public void publishByteBuffer() throws Exception {
5252
int frameMax = 10_000;
5353
int size = frameMax * 4;
5454
byte[] masterData = new byte[size];

0 commit comments

Comments
 (0)