Skip to content

Conversation

@davidmorley
Copy link
Contributor

Fix javadoc for fetch() maxWait parameter

Problem

The current javadoc for the maxWait parameter in both fetch() method overloads incorrectly states that it's "the maximum time to wait for the first message." This is misleading as it suggests the timeout only applies to receiving the initial message.

Solution

Updated the parameter descriptions to clarify that maxWait/maxWaitMillis is "the maximum time to wait to collect messages for the batch," which accurately reflects that the timeout governs the entire batch collection operation.

Changes

  • Updated @param maxWait description in javadoc for fetch(int batchSize, Duration maxWait) method
  • Updated @param maxWaitMillis description in javadoc for fetch(int batchSize, long maxWaitMillis) method

This change improves API documentation clarity for developers using JetStream pull subscriptions.

Copy link
Contributor

@scottf scottf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good clarification

@scottf scottf merged commit fa20326 into nats-io:main Aug 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants