

Services.AddMassTransit(serviceCollectionConfigurator => ConfigureServices((hostContext, services) => Private static IHostBuilder CreateHostBuilder(string args) => Logger.LogInformation("Responder2 running.") Var host = CreateHostBuilder(args).Build() However, I chose not to start the bus at this point but rather use the Worker Service lifetime events to do that (described later). I was then able to configure the MassTransit bus using dependency injection. I also added support to deploy the Worker Service as a systemd daemon. First up I installed a few NuGet packages to enable MassTransit using AWS SQS transport, and support for dependency injection.

I created a Worker Service using Visual Studio and adapted the template project to suit. Again, to reiterate my approach almost certainly isn’t best practice but served only to demonstrate the feasibility of the approach.
#Docker masstransit .net code
NB: This is all “hello world” style code so don’t look here for the best way to do things. Net Core 3.1 Worker Service running on Linux. The code contained herein was just sufficient to answer some basic questions around whether a MassTransit-based endpoint could be hosted in a. Be aware, this blog post contains my notes on some investigation work I recently undertook with MassTransit, the open source service bus for.
