// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IRabbitMQCustomer rabbitMQCustomer) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } //初始化RabbitMQ-Customer消费者 app.UseRabbitMQCustomer(rabbitMQCustomer); app.UseMvc(); }
public static IApplicationBuilder UseRabbitMQCustomer(this IApplicationBuilder app, IRabbitMQCustomer rabbitMQCustomer) { rabbitMQCustomer.CreateCustommerInstance(); return(app); }