Add advisory event when JetStream messages are removed from a stream #8436
AnasAhmedTMF
started this conversation in
Ideas
Replies: 1 comment
|
These limits (age etc) are not exceptional circumstances and especially the count ones would constantly spam advisories. Explicit purge and delete have advisories in the api already and max retries also - these are exceptional circumstances. I can’t imagine adding advisories for regular normal day to day (or even second to second) things it’s too expensive computationally to do. We also can’t put the payload as when this was previously suggested we had a lot of feedback that advisories end up in all sorts of places (ops tooling) and so would come with a huge risk of exfilling sensitive data. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add a new JetStream advisory that fires whenever a message is removed from a stream, regardless of the reason. This would cover all deletion scenarios:
Motivation
Currently, when a message is removed from a stream there is no notification mechanism. This makes it difficult to:
The existing advisory system covers stream/consumer create/delete/update but not message-level lifecycle events.
Proposed Design
Advisory Subject
Subscribable via wildcard:
$JS.EVENT.ADVISORY.STREAM.MSG_REMOVED.>Payload
{ "type": "io.nats.jetstream.advisory.v1.stream_msg_removed", "id": "<nuid>", "timestamp": "<RFC3339>", "stream": "<stream-name>", "seq": 123, "subject": "<original-msg-subject>", "reason": "max_age | max_bytes | max_msgs | interest | purge | delete", "data": "<base64-encoded-payload>", "hdr": "<base64-encoded-headers>" }Configuration
Since including the full payload could be expensive at high throughput, this could be opt-in at the stream config level:
{ "msg_delete_advisory": true, "msg_delete_advisory_include_payload": true }Or only emit the advisory with metadata (seq, subject, reason) by default, with payload inclusion as an option.
Considerations
Use Cases
All reactions