Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created July 14, 2024 17:48
Show Gist options
  • Save wullemsb/bdc11651809de1090b2f9698426c3150 to your computer and use it in GitHub Desktop.
Save wullemsb/bdc11651809de1090b2f9698426c3150 to your computer and use it in GitHub Desktop.
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