Skip to content
Back to skills

Nats Messaging

ASecurity

Build NATS Core and JetStream systems: subject design, stream retention, Pull consumers, ack waits and KV

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentbackend

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill nats-messaging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nats Messaging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nats Messaging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-nats-messaging/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-nats-messaging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Build NATS Core and JetStream systems: subject design, stream retention, Pull consumers, ack waits and KV
profile: standard
tags: nats, jetstream, messaging, backend
---

# NATS messaging

Use when designing NATS subjects, request-reply RPCs, or durable JetStream streams and consumers.

## Subject hierarchy and NATS Core
- Structure hierarchical dot-separated subjects cleanly (`orders.us.created.v1`), keeping high-cardinality IDs in safe positions so wildcard subscriptions (`orders.*.created.*`) stay flexible.
- Remember NATS Core is at-most-once fire-and-forget with zero offline persistence; use queue groups (`subscribe(subj, { queue: "workers" })`) for horizontal load balancing across workers.

## JetStream durability
- Use **JetStream Streams** whenever at-least-once delivery or replay is required. Set explicit `MaxMsgs`, `MaxBytes`, or `MaxAge` retention bounds (`LimitsPolicy`, `WorkQueuePolicy`, or `InterestPolicy`) so storage never grows silently without limit.
- Prefer **Pull consumers** with bounded batch sizes over Push consumers for worker fleets so each worker controls concurrency and memory backpressure.
- Match consumer `AckWait` to worst-case processing time and call `msg.working()` for slow tasks before `AckWait` expires and triggers redelivery.

## Reliability and safety
Send `Nats-Msg-Id` deduplication headers on publishes inside JetStream duplicate windows, use `term()` on unrecoverable poison messages, and separate credentials by subject publish/subscribe permissions (`NKey`/JWT).

## Verify
Tests checking queue-group single delivery in Core, JetStream redelivery after `nak()`, deduplication via `Nats-Msg-Id`, and stream retention eviction behavior.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.