nats-server
nats-server copied to clipboard
Number of subscribers (numsub)
trafficstars
In Redis there is a numsub function that returns the number of subscribers. This is important if I want to wait for a response of each subscriber. But how to do that with NATS?
Example:
- Get number of subscribers
- Ask each subscriber to return a count value
- Wait for number of subscribers to respond, or timeout
- Sum count values
+1, in need for this 👀
With the NATS cli, you can do the following to only show those connections that have subs on foo. This is not exactly what you need, but might help. Also if you add --trace to the command below you can see what raw requests and responses are being sent and received.
nats account report connections --subject=foo
Closing for now but feel free to re-open as needed.