how to recover from DiscardNew policy? #2794
-
hey guys, have a question related to jetstream's discard policy new But I tested this scenario and apparently that's not how it works: Is this expected behaviour? I'm trying to archieve behaviour that our producer starts to fail when stream is full (return error to client or whatever), but can recover from failure when consumers catch up later. If I keep discard policy to old and consumers starts to fail for some reason we might start to loose messages |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Streams have a separate state from consumers, unless the stream is in interest retention mode which then means when all consumers have ack'd a message it will be removed from the stream. That is probably what you want. |
Beta Was this translation helpful? Give feedback.
-
Docs improved in this commit https://github.com/jnmoyne/nats.docs/commit/dfdc6236745bf455062477e510bf8924717a5056 (which will be included in the next PR of my docs fork back to the nats-io docs repo |
Beta Was this translation helpful? Give feedback.
Streams have a separate state from consumers, unless the stream is in interest retention mode which then means when all consumers have ack'd a message it will be removed from the stream.
That is probably what you want.