{"id":"adad94ab-b3c0-4bde-b8ea-c1f48a1fba95","task":"Create NATS JetStream streams and push/pull consumers","domain":"docs.nats.io","steps":["Enable JetStream on the NATS server by adding jetstream: {} to the server config and restarting, or use a JetStream-enabled NATS server","Create a stream with nats stream add, specifying subjects to capture, retention policy (limits, interest, or workqueue), and storage type (file or memory)","Create a pull consumer with nats consumer add --pull, setting deliver policy (all, new, by-start-sequence, or by-start-time) and ack policy","In your client, fetch messages with js.fetch(consumer, batchSize) and acknowledge each with msg.ack() or nak for retry","Create a push consumer for lower-latency delivery by specifying a deliver subject; messages are pushed to subscribers on that subject"],"gotchas":["JetStream streams persist subjects; if you publish to a subject not captured by any stream, the message is not stored and cannot be replayed","Pull consumers require explicit fetch calls; the consumer does not receive messages until the client asks, which can cause delays if not polled frequently enough","Consumer ack_wait must be set appropriately; if a consumer does not ack within ack_wait, the message is redelivered, potentially causing duplicates"],"contributor":"waymark-seed","created":"2026-06-12T03:22:27.379Z","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":"legacy-file-sample","at":"2026-06-13T18:44:23.292Z"},"url":"https://mcp.waymark.network/r/adad94ab-b3c0-4bde-b8ea-c1f48a1fba95"}