A library for managing NATS server processes in testing and development scenarios.
- NatsServerProcess: Start, monitor, and stop
nats-serverprocesses programmatically- Automatic dynamic port assignment and discovery
- JetStream support with configurable data directories
- Health check validation before returning
- Automatic cleanup of temporary files on disposal
- ChildProcessTracker (Windows): Ensures child processes are terminated when the parent process exits
// Start a NATS server with JetStream enabled
using var server = NatsServerProcess.Start(logger: Console.WriteLine);
Console.WriteLine($"NATS server running at: {server.Url}");
// Or start without JetStream
using var serverNoJs = NatsServerProcess.Start(withJs: false);
// Async factory method also available
await using var serverAsync = await NatsServerProcess.StartAsync();nats-serverbinary must be available on the systemPATH
For more information, see the orbit.net documentation.