コード例 #1
0
        public void AddServices(IServiceCollection services)
        {
            var options = new RabbitMQOptions();

            _configure?.Invoke(options);
            services.AddSingleton(options);

            services.AddSingleton <IConsumerClientFactory, RabbitMQConsumerClientFactory>();
            services.AddTransient <IQueueExecutor, PublishQueueExecutor>();
        }
コード例 #2
0
        public void AddServices(IServiceCollection services)
        {
            services.AddSingleton <CapMessageQueueMakerService>();

            var options = new RabbitMQOptions();

            _configure?.Invoke(options);
            services.AddSingleton(options);

            services.AddSingleton <IConsumerClientFactory, RabbitMQConsumerClientFactory>();
            services.AddSingleton <IConnectionChannelPool, ConnectionChannelPool>();
            services.AddSingleton <IPublishExecutor, RabbitMQPublishMessageSender>();
            services.AddSingleton <IPublishMessageSender, RabbitMQPublishMessageSender>();
        }