Broker guide
NATS JetStream
Durable subject-based delivery with explicit ACK and pull consumers on all six runtimes.
When to use
Use when selecting a broker or configuring its Input/Sink endpoints.
Behavior
- Input receives messages into a pipeline; Sink publishes messages from a pipeline. Declaring an endpoint alone does not connect a graph.
- Check the deployed generator capability catalog for the selected language and direction. Updating a plugin alone does not update the backend.
- Creation is explicitly enabled per resource; existing-only is the default. Missing or incompatible resources fail instead of being silently replaced.
- Supply credentials through runtime environment/Vault configuration. Never embed secrets in architecture source, URLs or Help examples. TLS certificate paths require deployed files.
- Request completion (Done) is not a broker ACK. A publication result is not proof of downstream business processing. Unknown send outcomes must not be blindly retried.
- Input requires a named stream and durable consumer. A Sink PubAck confirms the JetStream publication, not the consumer business result.
Connection properties
Connection
PropertyTypeDescription
serversstring[]Explicit broker URL list; credentials are supplied separately.
connectTimeoutMs / operationTimeoutMsintegerConnection and operation deadlines in integer milliseconds.
tlsEnabled / tlsServerName / tlsCaFile / tlsCertFile / tlsKeyFilestringTLS configuration where exposed by this connector. Client certificate and key must be supplied together.
Endpoint properties
Endpoint
PropertyTypeDescription
subject / streamNamestringRequired stream and subject; subject must be covered by the stream.
durableNamestringRequired for Input.
createStream / createConsumerbooleanDefault false. Independent explicit creation; createConsumer applies only to Input.
Python DSL declaration (wire endpoints to Input/Sink separately)
from sa_dsl import Project, Function, LOCAL_MODULE
project = Project("BrokerExample")
broker = project.jetstream_connector("Events", servers=["nats://localhost:4222"])
endpoint = broker.subject("Receive events", subject="orders.created",
stream_name="ORDERS", durable_name="workers",
create_stream=False, create_consumer=False,
function=Function("ReceiveEvents", module=LOCAL_MODULE))