Last active
December 2, 2021 07:48
-
-
Save irfan-yusanif/a7e27b0250b99fb6cfb87799dbfc3c71 to your computer and use it in GitHub Desktop.
Configure NserviceBus
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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
await CreateHostBuilder(args).RunConsoleAsync(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) | |
{ | |
return Host.CreateDefaultBuilder(args) | |
.UseNServiceBus(context => | |
{ | |
var endpointConfiguration = new EndpointConfiguration("Sales"); | |
//configure transport - configure where your message will be published/saved | |
//you can configure it for RabbitMq, Azure Queue, Amazon SQS or any other cloud provider | |
endpointConfiguration.UseTransport<LearningTransport>(); | |
endpointConfiguration.SendFailedMessagesTo("error"); //When a message fails processing it will be forwarded here. | |
endpointConfiguration.AuditProcessedMessagesTo("audit"); //All messages received by an endpoint will be forwarded to the audit queue. | |
return endpointConfiguration; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment