Example #1
0
 private static void HostBus(IApplicationBuilder app)
 {
     ServiceBusHostProvider.Get().Host(app.ApplicationServices).UseRabbitMq()
     .ListenOn(
         "Domain.Commands",
         e =>
     {
         e.LoadFrom(app.ApplicationServices);
         e.PrefetchCount = 2;
         e.UseConcurrencyLimit(1);
     })
     .UseRetry(2, 2)
     .Start();
 }
Example #2
0
        static async Task Main(string[] args)
        {
            try
            {
                var serviceProvider = ConfigureServices();
                ServiceBusHostProvider.Get().Host(serviceProvider).UseRabbitMq()
                .ListenOn("Domain.Events",
                          e =>
                {
                    e.LoadFrom(serviceProvider);
                    e.PrefetchCount = 2;
                    e.UseConcurrencyLimit(1);
                })
                .UseRetry(2, 2)
                .Start();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            Console.WriteLine("Listening...");
        }