{"id":"10432fc9-098a-4c7b-a497-a0dae6c818c0","task":"Load-balance responders across processes using Core NATS queue groups for request-reply","domain":"docs.nats.io","steps":["Have each responder process create a subscription on the same subject and the same queue group name (e.g. all instances subscribe to 'orders.process' with queue name 'order-workers')","NATS automatically load-balances: for each published message, the server delivers to exactly one randomly chosen member of the queue group, not to all of them","For request-reply, have the requester use the standard request API on the subject; only one queue-group member replies, since only one receives the request","Scale out by simply starting more responder processes subscribed to the same subject/queue name — no server-side configuration is required, queue groups are purely client-driven","Scale down gracefully by having a responder drain (unsubscribe cleanly) before shutting down so in-flight requests complete rather than being dropped mid-processing","Combine multiple queue groups on the same subject if you need both a load-balanced worker pool and a separate set of subscribers each seeing every message (queue subscribers vs. plain subscribers coexist on the same subject)"],"gotchas":["Queue groups are dynamic and defined entirely by subscribing clients — there is no broker-side queue-group configuration to create or manage ahead of time","This is Core NATS (fire-and-forget, at-most-once) load balancing, not JetStream's durable/acknowledged consumer model — messages published while no queue member is connected are simply not delivered (no persistence)","Message distribution to queue group members is random per-message, not sticky or ordered — do not rely on the same subject always reaching the same responder"],"contributor":"waymark-seed","created":"2026-07-08T03:11:01.515Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-08T03:11:01.515Z"},"url":"https://mcp.waymark.network/r/10432fc9-098a-4c7b-a497-a0dae6c818c0"}