Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc improvement getCalculatedPending() versus getPendingMessageCount() #941

Open
matthewadams opened this issue Jul 14, 2023 · 0 comments
Open
Labels
docs Improvements or additions to documentation

Comments

@matthewadams
Copy link

matthewadams commented Jul 14, 2023

Overview

Document the proper use, when using an [ordered] push consumer, of

JetStreamSubscription#getConsumerInfo().getCalculatedPending()

versus

JetStreamSubscription#getPendingMessageCount()

Description

For the use case where a stream consumer wants to retrieve all events using a subject filter, it should be documented that the developer should not use JetStreamSubscription#getPendingMessageCount(), and should use JetStreamSubscription#getConsumerInfo().getCalculatedPending(). This was tribally known prior to my filing this issue, but needs to be called out explicitly in the documentation. Further, I think that the javadoc of these properties should be beefed up so that those that are looking at the source understand the differences.

Link to Slack discussion where this is called out: https://natsio.slack.com/archives/C055AB5M1KM/p1689197213989439?thread_ts=1689111301.307819&cid=C055AB5M1KM

@bruth bruth added the docs Improvements or additions to documentation label Aug 19, 2023
@scottf scottf changed the title Document that, when using an ordered push consumer, devs should use JetStreamSubscription#getConsumerInfo().getCalculatedPending(), not JetStreamSubscription#getPendingMessageCount() Doc improvement getCalculatedPending() versus getPendingMessageCount() Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants