Skip to content

KV Limit Marker#1310

Merged
scottf merged 5 commits intomainfrom
kv-limit-marker
Apr 30, 2025
Merged

KV Limit Marker#1310
scottf merged 5 commits intomainfrom
kv-limit-marker

Conversation

@scottf
Copy link
Contributor

@scottf scottf commented Apr 30, 2025

Accept a per message ttl when creating a kv. Implements ADR-43

public long create(String key, byte[] value, MessageTtl messageTtl) throws IOException, JetStreamApiException

Accept a per message ttl when creating a kv.

/**
* The time delete marker TTL duration. Server accepts 1 second or more.
* CLIENT DOES NOT VALIDATE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed my mind to now validate.

* @param subjectDeleteMarkerTtlMillis the TTL duration
* @return The Builder
*/
public Builder subjectDeleteMarkerTtl(long subjectDeleteMarkerTtlMillis) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

didn't originally have the ms api complement to the duration api

private long firstSequence = 1;
private boolean allowMessageTtl = false;
private Duration subjectDeleteMarkerTtl = Duration.ZERO;
private Duration subjectDeleteMarkerTtl;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

null is better and the getter already noted could be null

@scottf scottf requested a review from MauriceVanVeen April 30, 2025 13:30
Copy link
Member

@MauriceVanVeen MauriceVanVeen left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment

* @return The Builder
*/
public static MessageTtl seconds(int msgTtlSeconds) {
if (msgTtlSeconds < 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be msgTtlSeconds < 1 instead (or <= 0)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I need to fix this.

@scottf scottf merged commit 488612c into main Apr 30, 2025
5 checks passed
@scottf scottf deleted the kv-limit-marker branch April 30, 2025 20:01
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