Replies: 3 comments 4 replies
-
NATS JetStream has had the ability to source and mirror other streams since inception. And you can allow direct get() operations by subject on a stream without the intervention of consumer state. We have also allowed subject mappings and transforms at the account or server level. With a change that has landed on the dev branch, @jnmoyne has added the ability to transform subjects on ingest from another stream. Meaning, on the dev branch, you can source messages into a KV from another stream by transforming the subjects on ingest. So I think we are already there ;) Will let @jnmoyne expand more. |
Beta Was this translation helpful? Give feedback.
-
Why not just retrieve the last message per subject using the API? Duplicating all the data and coming up with solid remapping etc seems quite excessive when you could instead just get the message using the get API where it is already |
Beta Was this translation helpful? Give feedback.
-
Yeah - I guess support for this varies by client - KV is just a simplification to narrow down the huge API set of JetStream into a convention driven simplification, but generally you can do all it does with the API if you say which language you use I can see if I can find it |
Beta Was this translation helpful? Give feedback.
-
Since the KV feature is built off of streams (if I'm not mistaken), it would amazing if we could have a KV bucket automatically populated and updated from a stream.
The use case here is actually quite simple. We have a stream composed of a series of subjects that are all pushing regular updates. We have consumers that wish to receive all updates in relative real-time, while we have other consumers that simply want to be able to lookup the latest value for one or more subjects.
While we could support both using
DeliverLastPerSubject
andMaxMsgsPerSubject
to support both uses, the KV interface can be much simpler for looking up the latest values for known subjects.If this is something that is worthy of implementation, it would also be great if we could define a mapping between the subject and key name within the bucket.
Beta Was this translation helpful? Give feedback.
All reactions