A real server and client for a test — see the how-to
The split matters: importing nats/client alone does not pull a broker into your binary. Importing
nats/server does, and should be a decision rather than a side effect.
None of these structs is read from a file by this module. The calling application maps its own
configuration onto them. Every field carries mapstructure, yaml and json tags so that mapping
is a decode rather than a hand-written assignment.
The JetStream context, for everything past creation
Raw()
The underlying connection. An escape hatch, named as one
StreamSettings.Duplicates sets how long a stream remembers a publish's Nats-Msg-Id, so that a
repeated publish is stored once. Leaving it unset doesn't turn deduplication off: the server picks
two minutes, or MaxAge if that is shorter, or its own limit if that is shorter still. The server
refuses a window longer than MaxAge, and Stream returns that error. A window is not a bound, so
a stream with only Duplicates set is still refused as unbounded.