I had two clients, one doing the publishing and one doing the subscribing.
The client seems to be slow (mostly publishing, sending seems fine). gnatsd didn't even seem stressed.
The way I've done it so far, is there's an Overlay interface where I'm trying to implement a NATS-backed Overlay. Overlay provides Subscribe, Unsubscribe and Publish with its own Handler. I already have code using the Overlay interface, so this ideally should be a drop in replacement.
Specifically, our use case is allowing a single client connection to be able to communicate with many devices. Device connections both subscribe and publish to their own topic, and client connections subscribe and publish to all the device topics it has access to. Currently, the NATSOverlay class I've got has two NATS connections for potentially 50k subscriptions. Is this ideal?
Go version is 1.3.1.