Consumer topics sampling #5909
-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Not sure we have enough information about what you are looking at doing. Could we get more information about the stream (NATS CLI Streams have the ability to limit the number of msgs per subject, where MaxMsgsPerSubject of 1 only keeps the last value. This is how we do Key-Value materialized views. Streams can also republish msgs after they are timestamped and sequenced. You can republish on any subject transform you want. You could then create a stream or a KV with the subject filter that you want to capture and that will keep the last value. However you can always ask a stream for the last msg per subject which does not require a consumer. |
Beta Was this translation helpful? Give feedback.
Not sure we have enough information about what you are looking at doing.
Could we get more information about the stream (NATS CLI
nats str info <STREAM>
and the consumernats consumer info <STREAM> <CONSUMER>
?Streams have the ability to limit the number of msgs per subject, where MaxMsgsPerSubject of 1 only keeps the last value. This is how we do Key-Value materialized views.
Streams can also republish msgs after they are timestamped and sequenced. You can republish on any subject transform you want. You could then create a stream or a KV with the subject filter that you want to capture and that will keep the last value.
However you can always ask a stream for the last msg per subject wh…