Skip to content

Add consumer info usage warnings#1079

Merged
mtmk merged 6 commits into
mainfrom
add-consumer-info-usage-warnings
Feb 27, 2026
Merged

Add consumer info usage warnings#1079
mtmk merged 6 commits into
mainfrom
add-consumer-info-usage-warnings

Conversation

@mtmk

@mtmk mtmk commented Feb 26, 2026

Copy link
Copy Markdown
Member

Add performance warnings about frequent ConsumerInfo API calls.

Add performance warnings about frequent `ConsumerInfo` API calls.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation warnings to discourage frequent ConsumerInfo/$JS.API.CONSUMER.INFO calls and steer users toward message metadata for runtime progress signals.

Changes:

  • Add performance warning remarks to INatsJSContext.GetConsumerAsync documenting server load implications and alternatives.
  • Add warning remarks to INatsJSConsumer.Info and INatsJSConsumer.RefreshAsync about repeated refresh patterns.
  • Switch implementation XML docs in NatsJSContext/NatsJSConsumer to <inheritdoc /> to inherit the updated interface documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/NATS.Client.JetStream/NatsJSContext.Consumers.cs Uses <inheritdoc /> on GetConsumerAsync so warnings in the interface surface on the concrete implementation.
src/NATS.Client.JetStream/NatsJSConsumer.cs Uses <inheritdoc /> for Info and RefreshAsync so interface warnings apply to the implementation.
src/NATS.Client.JetStream/INatsJSContext.cs Adds detailed remarks warning about frequent CONSUMER.INFO calls and suggests alternatives.
src/NATS.Client.JetStream/INatsJSConsumer.cs Adds similar warning remarks on Info and RefreshAsync to reduce misuse.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/NATS.Client.JetStream/INatsJSContext.cs Outdated
Comment thread src/NATS.Client.JetStream/INatsJSConsumer.cs Outdated
Comment thread src/NATS.Client.JetStream/INatsJSConsumer.cs
@alexbozhenko

Copy link
Copy Markdown
Contributor

@mtmk is it possible to preview these docs rendered?

@scottf scottf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread .github/workflows/docs-preview.yml Fixed
@github-actions

github-actions Bot commented Feb 26, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request February 26, 2026 12:54 Inactive
mtmk and others added 3 commits February 26, 2026 12:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

This comment was marked as resolved.

…ts properties (#1080)

* Initial plan

* docs: clarify that INatsJSMsg.Metadata is nullable and must be checked before use

Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mtmk <386903+mtmk@users.noreply.github.com>
@mtmk

mtmk commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

@mtmk is it possible to preview these docs rendered?

thanks for checking this @alexbozhenko ... there is a preview now :-)

See the API docs e.g. https://69a0451d040192587a910687--teal-klepon-7e92d0.netlify.app/api/nats.client.jetstream.inatsjsconsumer.refreshasync#NATS_Client_JetStream_INatsJSConsumer_RefreshAsync_System_Threading_CancellationToken__remarks

Please check the 'Deployed on' link in comments for new commits.

@alexbozhenko

Copy link
Copy Markdown
Contributor

@mtmk great, the text is very clear!

@mtmk
mtmk merged commit a94b9eb into main Feb 27, 2026
24 checks passed
@mtmk
mtmk deleted the add-consumer-info-usage-warnings branch February 27, 2026 08:55
mtmk added a commit that referenced this pull request Mar 13, 2026
* Add optional window_size parameter to StreamSnapshotRequest (#1088)
* Bump Microsoft.Bcl.Memory from 9.0.0 to 9.0.14 (#1089)
* Fix `PingCommand` cancellation (#1086)
* rework terminate reason (#1081)
* Fix OTel network telemetry tags (#1078)
* Add consumer info usage warnings (#1079)
* Add TermWithReason support to AckTerminateAsync (#1048)
* Fix code analyser warning (#1076)
* Add cancelled token handling for consumers (#1068)
* Add validation for unsupported PinnedClient calls (#1063)
* Add see-also references to Orbit packages (#1077)
* Add Synadia.Orbit.Testing.NatsServerProcessManager (#1065)
* Add slow consumer docs (#1073)
* Fix error logs URI rewritten by OnConnectingAsync (#1067)
* Add more tests for JetStream consumer behavior (#1055)
@mtmk mtmk mentioned this pull request Mar 13, 2026
mtmk added a commit that referenced this pull request Mar 13, 2026
* Add optional window_size parameter to StreamSnapshotRequest (#1088)
* Bump Microsoft.Bcl.Memory from 9.0.0 to 9.0.14 (#1089)
* Fix `PingCommand` cancellation (#1086)
* rework terminate reason (#1081)
* Fix OTel network telemetry tags (#1078)
* Add consumer info usage warnings (#1079)
* Add TermWithReason support to AckTerminateAsync (#1048)
* Fix code analyser warning (#1076)
* Add cancelled token handling for consumers (#1068)
* Add validation for unsupported PinnedClient calls (#1063)
* Add see-also references to Orbit packages (#1077)
* Add Synadia.Orbit.Testing.NatsServerProcessManager (#1065)
* Add slow consumer docs (#1073)
* Fix error logs URI rewritten by OnConnectingAsync (#1067)
* Add more tests for JetStream consumer behavior (#1055)
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.

6 participants