Skip to content

Conversation

@caspervonb
Copy link
Collaborator

No description provided.

Signed-off-by: Casper Beyer <casper@synadia.com>
@caspervonb caspervonb requested a review from Copilot October 24, 2025 10:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for per-message Time-To-Live (TTL) functionality, a feature introduced in NATS Server 2.11+. The implementation allows clients to specify a TTL for individual messages published to JetStream streams that have the allow_msg_ttl option enabled.

Key changes:

  • Added msg_ttl parameter to publish() and publish_async() methods for setting per-message TTL in seconds
  • Added allow_msg_ttl configuration option to StreamConfig for enabling per-message TTL on streams
  • Added comprehensive test coverage verifying TTL behavior including message expiration and stream state updates

Reviewed Changes

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

File Description
nats/src/nats/js/api.py Added MSG_TTL header constant and allow_msg_ttl stream configuration field
nats/src/nats/js/client.py Implemented msg_ttl parameter in publish methods with nanosecond conversion logic
nats/tests/test_js.py Added comprehensive test validating TTL functionality with multiple expiration scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Casper Beyer <casper@synadia.com>
@caspervonb caspervonb requested a review from Copilot October 27, 2025 17:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


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

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs enabled auto-merge (squash) October 30, 2025 20:47
@caspervonb caspervonb disabled auto-merge October 30, 2025 20:57
@caspervonb caspervonb merged commit baaa325 into main Oct 30, 2025
62 checks 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.

3 participants