NATS Client
A simple, developer-friendly NATS client designed with an ergonomic API designed to allow you to use this client anywhere, whether you're using tokio
or single-threaded apps or traditional multi-threaded.
Usage
The following sample illustrates basic publish and subscribe features:
let jwt = "...";
let seed = "...";
let opts = builder
.cluster_uris
.authentication
.build?;
let client = from_options?;
client.connect?;
client.subscribe?;
To publish a message:
c.publish?;
And to utilize the request/response pattern:
let reply = client.request?;
let symbol: SymbolReply = from_slice.unwrap;
info!;
Features
The following is a list of features currently supported and planned by this client:
- - Request/Reply
- - Subscribe
- - Publish
- - All authentication models, including NATS 2.0 JWT and seed keys
- - Adherance to protocol v1, accepts new server information whenever it's sent from NATS
- - Automatic reconnect upon connection failure
- - TLS support
- - NATS Streaming (STAN)