Skip to content

Consumer topics sampling #5909

Answered by derekcollison
diorcety asked this question in Q&A
Sep 20, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

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 consumer nats 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…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@diorcety
Comment options

@derekcollison
Comment options

@diorcety
Comment options

@derekcollison
Comment options

@diorcety
Comment options

Answer selected by derekcollison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants