nats-io / nats.net

The official C# Client for NATS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing consumer configuration in KV store subscription

MENNAELMESALMY opened this issue · comments

Proposed change

In KV store I want to be able to pass metadata, description, and idleheartbeat time (basically some consumer configuration) to the associated consumer but I can't find a way to pass this config, am I missing something?
if there is currently no way to do it, can we consider adding it?

used version: v1 1.1.5

Use case

Same use cases as having JetStream's consumer metadata, we want to be able to pass some metadata about the current consumers in the bucket.

Contribution

I am thinking of having a class similar to ConsumerConfigurationBuilder that we can optionally ( with a new constructor) pass to Watch/WatchAll but would like to know if there is a process to follow to have that.

I could see having metadata and description because they are purely informational. Things like allowing custom heartbeats would have to be considered by the team and I can run it by them, and if we were going to allow some customization, we really should look at every possible consumer configuration that is available to us considering it's an ordered consumer under the covers.
Alternatively, remember KV is just something on top of JetStream, and all the code is there, so you could make your own watcher implementation, you would have to understand the way subjects are formed.

hi @scottf thanks for the quick reply.
We would like to continue to get any feature that the library provides smoothly so don't want to diverge too much with our own implementation.
If you agree that informational data is harmless (metadata, description) is harmless I could start drafting a PR for that.

For the heartbeat, I understand that the ordered consumer with a push subscription enables control flow (link) which enables the heartbeat but since it's not passed I assume that it's always the default I was looking to make it customizable. curious if that can lead to other side effects though, let me know what you and the team think.