Created
July 14, 2024 17:48
-
-
Save wullemsb/bdc11651809de1090b2f9698426c3150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args) | |
.ConfigureServices((hostContext, services) => | |
{ | |
services.AddMassTransit(x => | |
{ | |
// Automatically registers all consumers and consumerdefinitions in the current assembly | |
x.AddConsumers(typeof(Program).Assembly); | |
x.UsingRabbitMq((context,cfg) => | |
{ | |
cfg.ConfigureEndpoints(context); | |
}); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment