Search code examples
c#dockerasp.net-core.net-coremicroservices

Run non stop background task using asp.net core in linux container


I have a asp.net core API microservice from which i want to send notification using kafka to another microservice to send emails. Email microservice should always remain up without sleep in linux docker container (IIS doesn't work in linux container). What should be used to fulfill this criteria ?


Solution

  • You can use the Worker Service template

    IIS has a default recycling pool system so your app will be shutdown after X time of inactivity.

    You need to host you application on a Kestrel server.

    In an ideal world you will need a message broker system to manage your events and messages.