Ejemplo n.º 1
0
        /// <summary>
        /// 注册消费者服务,获取消费创建对象
        /// </summary>
        /// <param name="services"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static IActiveConsumerBuilder AddActiveConsumer(this IServiceCollection services, Action <ActiveConsumerOptions> configure)
        {
            ActiveConsumerOptions activeConsumerOptions = new ActiveConsumerOptions();

            configure?.Invoke(activeConsumerOptions);
            return(services.AddActiveConsumer(activeConsumerOptions));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 注册消费者服务,获取消费创建对象
 /// </summary>
 /// <param name="services"></param>
 /// <param name="activeConsumerOptions"></param>
 /// <returns></returns>
 public static IActiveConsumerBuilder AddActiveConsumer(this IServiceCollection services, ActiveConsumerOptions activeConsumerOptions)
 {
     services.AddActiveConsumerCore();
     return(new ActiveConsumerBuilder(services, activeConsumerOptions));
 }