Proposed change
Add AllowDirect as an optional configuration to NatsKVConfig so that KV streams can be configured to read from leader.
Use case
NATS KV Streams cannot currently be configured with AllowDirect = false which forces users to use Direct Get (read from followers):
Until nats-server has Read-after-Write consistency (issue #6557), disabling Direct Get is the ~recommended workaround (per discussion in #7281) to get more reliable reads (with the main gap still being leader changes).
Contribution
No response
Proposed change
Add AllowDirect as an optional configuration to NatsKVConfig so that KV streams can be configured to read from leader.
Use case
NATS KV Streams cannot currently be configured with AllowDirect = false which forces users to use Direct Get (read from followers):
nats.net/src/NATS.Client.KeyValueStore/NatsKVContext.cs
Line 274 in f2fc733
Until nats-server has Read-after-Write consistency (issue #6557), disabling Direct Get is the ~recommended workaround (per discussion in #7281) to get more reliable reads (with the main gap still being leader changes).
Contribution
No response