Milan Jovanović
Read post

Getting Started With NATS JetStream in .NET

NATS JetStream is a lightweight, fast messaging system that rarely gets mentioned in .NET circles despite being a compelling alternative to RabbitMQ or Azure Service Bus. Running as a single 18 MB Go binary with no external dependencies, NATS with JetStream enabled provides durable, at-least-once delivery. The guide walks through setting up NATS via Docker Compose, wiring the .NET client into ASP.NET Core DI, publishing typed messages from a Minimal API endpoint, and consuming them in a BackgroundService. Key concepts covered include stream retention modes (Workqueue, Limits, Interest), storage options (File vs Memory), and the critical rule of acknowledging messages only after the side effect completes to ensure reliability. Idempotent consumer handling is also highlighted as a necessary companion pattern.

    #architecture#.net#aspnetcore
Jun 26•6m read time•From milanjovanovic.tech
Post cover image
Table of contents
Core NATS vs JetStreamWhy It's Worth a LookSet It UpPublish a JobProcess Jobs in a WorkerAcknowledge After the Side EffectSummary
25.4K Impressions
Milan Jovanović's image
Milan Jovanović

MilanJovanovic's platform covers topics related to software development, technology trends, and cod...

722 Followers

•

2.9K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard