Proposed change
nats.py's nats.js.api.KeyValueConfig as long as nats.js.api.StreamConfig do not expose the JetStream's "limit marker" option required to enable per-key TTL with delete markers. While KeyValueConfig's ttl option sets the expiration for values, without limit_marker_ttl the client cannot receive PURGE events when keys expire.
As a workaround, it is currently possible to declare a kv externally, e.g. using the nats-cli: nats kv add mybucket --ttl=60s --marker-ttl=60s.
Proposed solution: add new field limit_marker_ttl to nats.js.api.KeyValueConfig, then add the same field to nats.js.api.StreamConfig and check if it's handled correctly in nats.js.manager.JetStreamManager.add_stream.
Context:
- nats-py version: 2.11.0
- nats-server version: 2.11.8
References:
Use case
I need to watch not only PUT events in a KV bucket, but also PURGE events when keys are automatically deleted according to the bucket's TTL policy. Without limit_marker_ttl, I cannot achieve feature parity with other SDKs and cannot reliably react to key expirations.
Contribution
No response
Proposed change
nats.py's
nats.js.api.KeyValueConfigas long asnats.js.api.StreamConfigdo not expose the JetStream's "limit marker" option required to enable per-key TTL with delete markers. While KeyValueConfig'sttloption sets the expiration for values, withoutlimit_marker_ttlthe client cannot receivePURGEevents when keys expire.As a workaround, it is currently possible to declare a kv externally, e.g. using the nats-cli:
nats kv add mybucket --ttl=60s --marker-ttl=60s.Proposed solution: add new field
limit_marker_ttltonats.js.api.KeyValueConfig, then add the same field tonats.js.api.StreamConfigand check if it's handled correctly innats.js.manager.JetStreamManager.add_stream.Context:
References:
KeyValueConfigwith support ofLimitMarkerTTLin Go SDK: https://pkg.go.dev/github.com/nats-io/nats.go/jetstream#KeyValueConfigUse case
I need to watch not only
PUTevents in a KV bucket, but alsoPURGEevents when keys are automatically deleted according to the bucket's TTL policy. Withoutlimit_marker_ttl, I cannot achieve feature parity with other SDKs and cannot reliably react to key expirations.Contribution
No response