public RabbitMQAdapterReceiver(RabbitMQStreamProviderConfig config, Logger logger, QueueId queueId, string providerName, IRabbitMQMapper mapper)
 {
     _config       = config;
     _logger       = logger;
     _queueId      = queueId;
     _mapper       = mapper;
     _providerName = providerName;
 }
Esempio n. 2
0
 public RabbitMQAdapter(RabbitMQStreamProviderConfig config, Logger logger, string providerName, IStreamQueueMapper streamQueueMapper, IRabbitMQMapper mapper)
 {
     _config            = config;
     _logger            = logger;
     Name               = providerName;
     _streamQueueMapper = streamQueueMapper;
     _mapper            = mapper;
     _queues            = new ConcurrentDictionary <QueueId, object>();
 }
        public void Init(IProviderConfiguration config, string providerName, Logger logger, IServiceProvider serviceProvider)
        {
            _config       = new RabbitMQStreamProviderConfig(config);
            _providerName = providerName;
            _logger       = logger;

            _mapper.Init(logger);

            _cacheSize    = SimpleQueueAdapterCache.ParseSize(config, 4096);
            _adapterCache = new SimpleQueueAdapterCache(_cacheSize, logger);

            _streamQueueMapper = new HashRingBasedStreamQueueMapper(_config.NumQueues, _providerName);

            if (StreamFailureHandlerFactory == null)
            {
                StreamFailureHandlerFactory =
                    qid => Task.FromResult <IStreamFailureHandler>(new NoOpStreamDeliveryFailureHandler(false));
            }
        }
 public static IQueueAdapterReceiver Create(RabbitMQStreamProviderConfig config, Logger logger, QueueId queueId, string providerName, IRabbitMQMapper mapper)
 {
     return(new RabbitMQAdapterReceiver(config, logger, queueId, providerName, mapper));
 }