Alumna::Nats
One NATS client for the process. Not a Service adapter.
Constructors
Open a client. servers is a URI, a URL string, or a list of servers.
Pass nkeys_file or user_credentials when the server requires them.
Returns Error when the driver fails. Raises ArgumentError for a bad URL.
Class methods
Instance methods
JetStream helper. You must create a stream and a durable push consumer.
Publish does not create a stream. Subscribe does not create a consumer.
The handler does not ack.
For a job queue, create the stream with retention: :workqueue.
Core publish. Does not wait for subscribers. Payload is String or Bytes.
Empty or invalid subject raises ArgumentError. App owns the subject name.
Core subscribe. Does not block.
With no queue_group, each current subscriber gets a copy (fan-out).
With queue_group, subscribers in that group compete (one delivery per message).
Empty or invalid subject, or empty queue_group, raises ArgumentError.
Wildcards * and > are valid here. Core NATS does not persist the message.