Created
April 22, 2022 12:19
-
-
Save alikrc/4becb5a8f07eb6b496f4e1472e3021c0 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
using MassTransit; | |
using Microsoft.Extensions.Hosting; | |
using System.Reflection; | |
var builder = Host.CreateDefaultBuilder(args); | |
builder.ConfigureServices((hostContext, services) => | |
{ | |
services.AddMassTransit(busConfigurator => | |
{ | |
var entryAssembly = Assembly.GetExecutingAssembly(); | |
busConfigurator.AddConsumers(entryAssembly); | |
busConfigurator.UsingRabbitMq((context, busFactoryConfigurator) => | |
{ | |
busFactoryConfigurator.Host("rabbitmq", "/", h => { }); | |
busFactoryConfigurator.ConfigureEndpoints(context); | |
}); | |
}); | |
}); | |
var app = builder.Build(); | |
app.Run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment