Example #1
0
        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"; });
            });
        }
Example #2
0
        // 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"));
                });
            });
        }
Example #3
0
 public RabbitMqOptions()
 {
     Connection = new RabbitMqConnectionConfigure();
 }