示例#1
0
 public void Initialize(
     IBrokerIngress brokerIngress,
     IEnumerable <IIngressApi> apis,
     IDiContainerAdapter serviceProvider)
 {
     _state.InitializedCount++;
 }
        /// <inheritdoc />
        public void Initialize(
            IBrokerIngress brokerIngress,
            IEnumerable <IIngressApi> apis,
            IDiContainerAdapter serviceProvider)
        {
            if (_isInitialized)
            {
                throw new PoezdOperationException("Kafka ingress driver is already initialized.");
            }

            _brokerIngress   = brokerIngress ?? throw new ArgumentNullException(nameof(brokerIngress));
            _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
            _apis            = apis ?? throw new ArgumentNullException(nameof(apis));

            GetRequiredServices();
            CreateAndRegisterConsumerPerApi();

            _isInitialized = true;
        }