Skip to content

Commit 93ad1c2

Browse files
authoredAug 19, 2024··
Remove redundant writer.flushBuffer() call (#1207)
When doing a request through `requestFutureInternal` we'd publish the message into the outgoing write queue, and immediately after call `writer.flushBuffer()`. Due to the message needing to go through the outgoing message queue, which takes a small amount of time, the `flushBuffer` would be done first and before our message got written to the `dataPort`. Removing the call to `writer.flushBuffer()` since it doesn't actually flush our message/request. Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
1 parent d4849d8 commit 93ad1c2

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed
 

‎src/main/java/io/nats/client/impl/NatsConnection.java

-1
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,6 @@ CompletableFuture<Message> requestFutureInternal(String subject, Headers headers
13231323
}
13241324

13251325
publishInternal(subject, responseInbox, headers, data, validateSubRep);
1326-
writer.flushBuffer();
13271326
statistics.incrementRequestsSent();
13281327

13291328
return future;

0 commit comments

Comments
 (0)
Please sign in to comment.