cloops.microservices
1.0.13
See the version list below for details.
dotnet add package cloops.microservices --version 1.0.13
NuGet\Install-Package cloops.microservices -Version 1.0.13
<PackageReference Include="cloops.microservices" Version="1.0.13" />
<PackageVersion Include="cloops.microservices" Version="1.0.13" />
<PackageReference Include="cloops.microservices" />
paket add cloops.microservices --version 1.0.13
#r "nuget: cloops.microservices, 1.0.13"
#:package cloops.microservices@1.0.13
#addin nuget:?package=cloops.microservices&version=1.0.13
#tool nuget:?package=cloops.microservices&version=1.0.13
CLOOPS Microservices SDK
An opinionated library to build highly available, lean and scalable cloud native microservices using NATS as primary communication layer.
🚀 Overview
The goal here is to minimize the undifferentiated work and give you all the bells and whistles for a lean, high performance and scalable microservices setup. Check out docs for more details on how this SDK works, and prepare to be impressed!
This SDK uses NATS as the primary way for your services to communicate with each other. i.e. No REST interface
💎 Why C# for Microservices?
Modern C# is an excellent choice for building microservices! It's lean, fast, and fully open source with cross-platform support. With .NET's native Linux support, you get exceptional performance that rivals or exceeds many other languages. C# offers a perfect balance of developer productivity, type safety, and runtime efficiency—making it ideal for high-throughput, low-latency microservices architectures. Plus, with features like async/await, minimal APIs, and native AOT compilation, you can build services that are both performant and maintainable.
It is highly recommended that you familiarize yourself with NATS. Below are some really good resources -
This SDK focuses on building microserivices using NATS. It is based on the cloops.nats which provides annotations based way to define consumers and bunch of other foundational things. Please do check it out.
⚡ Why use NATS over REST?
- Lower latency
- Higher throughput
- No protocol bloat
- Can implement temporal decoupling quite easily
- No additional hops for load balancing
- Decentralized PKI based AuthN and AuthZ
- No network ports exposed
- Easy to create highly available, globally distributed services
If you would like to know more, I would highly recommend checking out below resources
Documentation
Check out the docs.
🌱 Environment Variables used by SDK
📡 NATS related environment variables
Below are the environment variables used by CLOOPS.NATS
NATS_URL- Specifies the NATS server URL. Defaults to
tls://nats.ccnp.cloops.in:4222. - For running on prod CCNP, make sure you set it to
tls://nats-headless.ccnp.cloops.in:4222for faster within cluster operations.
- Specifies the NATS server URL. Defaults to
NATS_CREDS- Inline content of the NATS credentials file used for authentication. No default.
NATS_SUBSCRIPTION_QUEUE_SIZE- This variable defines what should be the max limit of messages queued up for each subscription. Use this to control backpressure. Default: 20,000
NATS_CONSUMER_MAX_DOP- Defines maximum degree of parallelism for all consumers. These many messages can be processed in parallel from the message queue. Default: 128
- This puts upper limit on rps (request per second), not literally, but indirectly. (e.g. if your avg latency is 200ms then max_dop * 5 is your max throughput). Increase this in order to support higher rps. Consider giving higher core / memory count as well.
- (Caution) Minting Service related environment variables
- Highly confidential. Only use in trusted services running on trusted infrastructure.
- Used by minting service when you need your application to mint new NATS tokens.
NATS_ACCOUNT_SIGNING_SEED- Signing account seed
- How to get it
- On nats-box
- run
cd /data/nsc/nkeys/keys/A - run
find . -type f -name "*.nk" -o -name "*.seed" - run
cat <account-signing-public-key>.nkto get the account signing seed. (remember to pick public key of singing account not main account)
NATS_ACCOUNT_PUBLIC_KEY- Main account public key
- How to get it
- Run this on nats-box to get the account public key:
nsc list keys --account=<account-name>(remember to pick the main account not signing key)
- Run this on nats-box to get the account public key:
🧪 Microservice operation related environment variables
DEBUG- Turns on verbose logging and additional diagnostics when set to
True. Defaults toFalse.
- Turns on verbose logging and additional diagnostics when set to
CCNPOTELENDPOINT- OTEL collector endpoint for exporting telemetry to CCNP. No default.
CCNPOTELHEADERS- Additional OTEL headers required when sending telemetry to CCNP. No default.
CLUSTER- Target cluster where the service runs. Defaults to
ccnp.
- Target cluster where the service runs. Defaults to
CNSTR- SQL connection string. No default.
ENABLE_NATS_CONSUMERS- Controls whether NATS consumers start with the service. Defaults to
False.
- Controls whether NATS consumers start with the service. Defaults to
🧭 Additional Setup you might need to do
- Database deployments.
- NATS JetStream streams, consumer creation
- Secret management (Doppler) integration
These things are usually taken care at CI/CD level or as manual one time setup operations or combination of both. How to do these things highly varies based on project and company.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- cloops.nats (>= 1.1.6)
- cronos (>= 0.11.1)
- Microsoft.Data.SqlClient (>= 6.1.1)
- Microsoft.Extensions.Hosting (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Logging.Console (>= 9.0.0)
- OpenTelemetry (>= 1.12.0)
- OpenTelemetry.Api (>= 1.12.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.12.0)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.Http (>= 1.12.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.12.0)
- OpenTelemetry.Instrumentation.SqlClient (>= 1.12.0-beta.2)
- Serilog (>= 4.3.0)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Extensions.Hosting (>= 9.0.0)
- Serilog.Formatting.Compact (>= 3.0.0)
- Serilog.Sinks.Console (>= 6.0.0)
- System.Linq.Async (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.13 | 89 | 1/11/2026 |
| 1.1.12 | 181 | 12/23/2025 |
| 1.1.11 | 143 | 12/23/2025 |
| 1.1.10 | 154 | 12/23/2025 |
| 1.1.9 | 124 | 12/21/2025 |
| 1.1.8 | 276 | 12/16/2025 |
| 1.1.7 | 237 | 12/16/2025 |
| 1.1.6 | 234 | 12/16/2025 |
| 1.1.5 | 237 | 12/16/2025 |
| 1.1.4 | 254 | 12/16/2025 |
| 1.1.3 | 241 | 12/16/2025 |
| 1.1.2 | 240 | 12/16/2025 |
| 1.1.1 | 236 | 12/16/2025 |
| 1.0.14 | 250 | 12/15/2025 |
| 1.0.13 | 238 | 12/15/2025 |
| 1.0.12 | 291 | 11/17/2025 |
| 1.0.11 | 292 | 11/17/2025 |
| 1.0.10 | 180 | 11/9/2025 |
| 1.0.9 | 217 | 11/9/2025 |
| 1.0.8 | 175 | 11/9/2025 |