Motor.NET is a micro-service framework for .NET built on top of Microsoft Generic Hosting. It provides easy integration of RabbitMQ, Kafka (WIP) and HTTP as well as helpers for logging and tracing.
You should be up and running with just a few lines of code.
You find working examples for different use-cases under the examples folder.
- Consume and publish to RabbitMQ
- Consume and publish to Kafka
- Consume and publish multiple messages at once to RabbitMQ
- Create a service with metrics
- Create a service with custom traces
Component | Consume | Publish | CloudEvents | Metrics | Compression | Custom |
---|---|---|---|---|---|---|
RabbitMQ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | priority, dynamic routing |
Kafka | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | partitioning key, dynamic topic |
Http | (:heavy_check_mark:) | (:heavy_check_mark:) | ❌ | ✔️ | ❌ | |
Timer | (:heavy_check_mark:) | - | ❌ | ❌ | ❌ | |
SQS | (:heavy_check_mark:) | - | ❌ | ❌ | ❌ | |
NATS | (:heavy_check_mark:) | (:heavy_check_mark:) | ❌ | ❌ | ❌ |
Motor.NET comes by default already with two health checks for message processing services (RabbitMQ, Kafka, Timer, and SQS):
MessageProcessingHealthCheck
: Fails when no messages were consumed in a certain time frame from the Motor.NET internal queue although it has at least some messages.TooManyTemporaryFailuresHealthCheck
: Fails when too many messages led to a failure since the last message was correctly handled (either successful or as invalid input).
Gzip compression can optionally be enabled for consumers and publishers. By enabling it for a publisher, the payload of all published messages will be compressed. Enabling it for a consumer will allow the consumer to decompress these messages. Consumers can however still consume uncompressed messages. This should make it easy to enable compression in an existing environment that does not use compression yet. It just needs to be enabled first for the consumers and afterwards for the publishers.
Motor.NET is provided under the MIT license.