public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddRabbitMq(option => { var connection = new RabbitMqConnectionConfigure(); Configuration.Bind(typeof(RabbitMqConnectionConfigure).Name, connection); option.Connection = connection; }); services.AddEventBus() .AddRabbitMq(configureOptions => { configureOptions.AddPublishConfigure(option => { option.ExchangeName = "Customer_Exchange"; }); }); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddRabbitMq(option => { var connection = new RabbitMqConnectionConfigure(); Configuration.Bind(typeof(RabbitMqConnectionConfigure).Name, connection); option.Connection = connection; }); services.AddEventBus() .AddEventHandler <UserEvent, UserEventHandler>() .AddRabbitMq(configureOptions => { configureOptions.AddSubscribeConfigures(options => { options.Add(new RabbitMqSubscribeConfigure(typeof(UserEvent), "Customer_Exchange", "Customer_Queue")); }); }); }
public RabbitMqOptions() { Connection = new RabbitMqConnectionConfigure(); }