nats

Designs NATS pub/sub and JetStream messaging flows for distributed microservices with routing, load balancing, and timeouts.

182|8|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/compozy/agh --skill nats-compozy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nats
Source: https://github.com/compozy/agh/tree/main/.agents/skills/nats
Command: npx skills add https://github.com/compozy/agh --skill nats-compozy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

NATS skill helps you design reliable, cloud-native messaging patterns so distributed services can communicate quickly without manual integration work.

Core Features & Use Cases

  • Core NATS + Subject Routing: Publish/subscribe using dot-separated subjects with single and multi-level wildcards for targeted delivery.
  • JetStream Persistence: Add durable streams and consumers for at-least-once delivery, replay, and operational control.
  • Request/Reply & Load Balancing: Use request/reply with timeouts and queue groups for scalable worker distribution.

Use case: You are building an order-processing microservice system where multiple workers handle orders.process, while a validator service answers orders.validate requests with strict timeouts and optional durable replay via JetStream.

Quick Start

Use the NATS skill to draft a minimal publish/subscribe and request/reply example for your service and include the correct subject wildcards and timeouts for localhost deployment.

Frequently Asked Questions about nats

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design request/reply messaging with timeouts for microservices?

To design request/reply messaging, use NATS core semantics to pair requests with replies and apply deterministic timeouts. This ensures strict response deadlines for services like an order validator answering requests without indefinite blocking.

What is the best way to route pub/sub messages using subject wildcards?

Routing pub/sub messages with subject wildcards enables targeted delivery across distributed services. NATS uses dot-separated subjects with single and multi-level wildcards, allowing subscribers to filter and receive only the specific event categories they need.

How do I configure JetStream persistence for at-least-once delivery?

Configuring JetStream persistence involves adding durable streams and consumers to your messaging flow. This provides at-least-once delivery guarantees, operational control, and message replay capabilities for microservices requiring reliable event processing.

Can I use queue groups for load balancing across multiple worker instances?

Yes, queue groups enable load balancing across multiple worker instances. NATS queue-group semantics distribute messages among competing workers subscribed to the same subject, enabling scalable microservice processing for tasks like order handling.

Does NATS support durable replay for distributed microservices?

NATS supports durable replay for distributed microservices through JetStream. By configuring durable streams and consumers, services can replay missed messages, providing operational control and ensuring data persistence across system restarts.

Why are my microservices not receiving messages with subject wildcards?

Microservices fail to receive messages with subject wildcards when subject patterns mismatch the published dot-separated structure. Verify that single and multi-level wildcards align correctly with your publish subjects to ensure proper targeted delivery.