Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created Jan 19, 2022
Embed
What would you like to do?
private static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseNServiceBus(_ =>
{
var endpointConfiguration = new EndpointConfiguration("eShopOnWebEDA");
endpointConfiguration.UsePersistence<LearningPersistence>();
endpointConfiguration.EnableInstallers();
endpointConfiguration.EnableMessagePropertyEncryption(new RijndaelEncryptionService("2021-11", Convert.FromBase64String("gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6")));
var transport = endpointConfiguration.UseTransport<RabbitMQTransport>();
transport.ConnectionString("host=localhost");
transport.UseConventionalRoutingTopology();
var routing = transport.Routing();
routing.RouteToEndpoint(
assembly: typeof(OrderPlacedEvent).Assembly,
destination: "eShopOnWebEDA");
return endpointConfiguration;
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment