Blog Logo
TAGS

Salus - Achieving Eventual Consistency in Microservices with Entity Framework

Salus is a tool that helps ensure the safety and well-being of your data in a Microservices-based system using Entity Framework. It provides a simple means of adding resiliency - so that if your message system or one of your microservices is unavailable, your data still regains eventual consistency. Salus aids with the safety and well-being of your data in your Microservices-based system by providing a very simple means of adding resiliency. This project is still being built, so do not use it until it is completed. To set up the demo, install Docker and ensure it is running. Then run RabbitMQ with the following command: docker run -d --hostname salus-demo --name salus-demo-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management. You can use any messaging system you like with Salus, but the demo programs make use of RabbitMQ for messaging. After setting up the demo, create a DbContext in the same way as usual, except inherit from SalusDbContext instead of DbContext and apply the `[SalusSourceDbSet]` attribute to any DbSet that you want Salus to monitor. Then create a Message Sender by implementing IAsyncMessageSender, register with dependency injection and start hosting services to run. Finally, use Salus like any other DbContext in your microservices-based system.