Skip to content

Commit

Permalink
Try to parallelize the push message wait time
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed May 8, 2024
1 parent 855bbd2 commit 598e3fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/nats/client/impl/MessageQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ boolean push(NatsMessage msg, boolean internal) {
return this.queue.offer(msg);
}

long timeoutLeft = Math.min(100, offerTimeoutMillis - (System.currentTimeMillis() - start));
long timeoutLeft = Math.max(100, offerTimeoutMillis - (System.currentTimeMillis() - start));

if (!this.queue.offer(msg, timeoutLeft, TimeUnit.MILLISECONDS)) {
throw new IllegalStateException(OUTPUT_QUEUE_IS_FULL + queue.size());
Expand Down

0 comments on commit 598e3fe

Please sign in to comment.