Problem
The nats_kv input redelivers all keys on restart. Which can be problematic if we're reading from a bucket with a large number of keys.
There is an include_history option. But this:
- includes historical values for a given key when set to
true
- includes only the latest value for a given key when set to
false
Suggested fix
Expose an updates_only toggle option which passes jetstream.UpdatesOnly() to the nats client when true . Only problem with this is that the nats client will throw an error when both updates_only and include_history are set to true:
nats: invalid jetstream option: updates only can not be used with include history
Problem
The
nats_kvinput redelivers all keys on restart. Which can be problematic if we're reading from a bucket with a large number of keys.There is an
include_historyoption. But this:truefalseSuggested fix
Expose an
updates_onlytoggle option which passesjetstream.UpdatesOnly()to the nats client whentrue. Only problem with this is that the nats client will throw an error when bothupdates_onlyandinclude_historyare set totrue:nats: invalid jetstream option: updates only can not be used with include history