public SimpleAsyncMessageProcessingWorker(IQueueConsumer consumer, Func <T, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout) : base(consumer) { _callbackFunc = callbackFunc; _processingTimeout = processingTimeout; }
public SimpleAsyncProcessingWorker(IQueueConsumer consumer, Func <T, RabbitMQConsumerContext, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout, ILogger logger = null) : base(consumer, logger) { _callbackFunc = callbackFunc; _processingTimeout = processingTimeout; }
public AdvancedMessageProcessingWorker(IQueueConsumer consumer, Action <T> callbackAction, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds) { _callbackAction = callbackAction; }
public AdvancedProcessingWorker(IQueueConsumer consumer, Action <T, RabbitMQConsumerContext> callbackAction, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0, ILogger logger = null) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, logger) { _callbackAction = callbackAction; }
public QueueConsumerRecovery(ConsumeMode mode, IQueueConsumer consumer, string queue, string consumerTag2, bool withoutAcks, bool exclusive, IDictionary <string, object> arguments) : this(mode, queue, consumerTag2, withoutAcks, exclusive, arguments) { _consumer2 = consumer; }
public Task <string> BasicConsume(ConsumeMode mode, IQueueConsumer consumer, string queue, string consumerTag, bool withoutAcks, bool exclusive, IDictionary <string, object> arguments, bool waitConfirmation) { EnsureOpen(); if (consumer == null) { throw new ArgumentNullException("consumer"); } if (!waitConfirmation && string.IsNullOrEmpty(consumerTag)) { throw new ArgumentException("You must specify a consumer tag if waitConfirmation = false"); } if (!string.IsNullOrEmpty(consumerTag)) { RegisterConsumer(mode, consumer, consumerTag); } return(_io.__BasicConsume(mode, queue, consumerTag, withoutAcks, exclusive, arguments, waitConfirmation, consumerTag2 => { RegisterConsumer(mode, consumer, consumerTag2); })); }
public AdvancedProcessingWorker(IQueueConsumer consumer, Action <IEnumerable <T> > batchCallbackAction, ushort batchSize, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0, ILogger logger = null) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, logger) { _batchCallbackAction = batchCallbackAction; _batchSize = batchSize; }
public SequentialProcessingEventListener(IQueueConsumer <TMessage> queueConsumer) { _queueConsumer = queueConsumer ?? throw new ArgumentNullException(nameof(queueConsumer)); _processingQueues = new ConcurrentDictionary <string, ProcessingQueue <TMessage> >(); _tasks = new ConcurrentDictionary <string, Task>(); this.performanceLoggingMethodName = GetType().Name + "." + nameof(ProcessMessageAsync); }
public void Stop() { if (Consumer != null) { Consumer.Stop(); Consumer = null; } }
public SimpleAsyncProcessingWorker(IQueueConsumer consumer, Func <IEnumerable <T>, CancellationToken, Task> batchCallbackFunc, ushort batchSize, TimeSpan processingTimeout, ILogger logger = null) : base(consumer, logger) { _batchCallbackFunc = batchCallbackFunc; _processingTimeout = processingTimeout; _batchSize = batchSize; }
public AdvancedAsyncMessageProcessingWorker(IQueueConsumer consumer, Func <T, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds) { _callbackFunc = callbackFunc; _processingTimeout = processingTimeout; }
public ServiceRunner( IOcrProcessingService carService, IAdapterConfiguration adapterConfiguration, IQueueConsumer <RecogniseBatchCourtesyAmountRequest> carRequestQueueConsumer) { this.adapterConfiguration = adapterConfiguration; this.carRequestQueueConsumer = carRequestQueueConsumer; this.carService = carService; }
protected AbstractAdvancedMessageProcessingWorker(IQueueConsumer consumer, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0) : base(consumer) { InvokeRetryCount = invokeRetryCount; InvokeRetryWaitMilliseconds = invokeRetryWaitMilliseconds; ExceptionHandlingStrategy = exceptionHandlingStrategy; }
private void RegisterConsumer(ConsumeMode mode, IQueueConsumer consumer, string consumerTag) { RegisterConsumer(consumerTag, new BasicConsumerSubscriptionInfo { ConsumerTag = consumerTag, Mode = mode, _consumer = consumer }); }
//private readonly ServiceWrapperConf _conf; public ServiceWrapper(IQueueConsumer consumer, IImplFactory <TServDef, TImpl> impl, Action <ServiceWrapperConf>?confAct = null) { _consumer = consumer; _impl = impl; var conf = new ServiceWrapperConf(); confAct?.Invoke(conf); _deps = new DepsCatalog(conf, new TServDef(), typeof(TImpl)); }
public ServiceRunner( IQueueConfiguration queueConfiguration, IQueueConsumer <CreateBatchAdjustmentLettersRequest> consumer, IExchangePublisher <CreateBatchAdjustmentLettersResponse> publisher) { this.queueConfiguration = queueConfiguration; this.consumer = consumer; this.publisher = publisher; }
private void RegisterCommands(IQueueConsumer qConsumer) { if (!_commandCatalog.GetConsumeRoute().IsApplicable) { return; } _deps.Logger.LogDebug($"Register command queue: {_commandCatalog.GetConsumeRoute().Queue}"); qConsumer.RegisterCommandConsumer(_commandCatalog.GetConsumeRoute().Queue, _commandCatalog.GetExecuter()); }
public static async Task <SimpleProcessingWorker <T> > CreateAndStartAsync(IQueueConsumer consumer, Action <T, RabbitMQConsumerContext> callbackAction, CancellationToken cancellationToken, ILogger logger = null) { var instance = new SimpleProcessingWorker <T>(consumer, callbackAction, logger); await instance.StartAsync(cancellationToken).ConfigureAwait(false); return(instance); }
public ServiceRunner( IQueueConfiguration queueConfiguration, IQueueConsumer<ExecuteBatchReportRequest> requestConsumer, IExchangePublisher<ExecuteBatchReportResponse> responsePublisher) { this.queueConfiguration = queueConfiguration; this.requestConsumer = requestConsumer; this.responsePublisher = responsePublisher; }
public ServiceRunner( IQueueConfiguration queueConfiguration, IQueueConsumer<CreateBatchAdjustmentLettersRequest> consumer, IExchangePublisher<CreateBatchAdjustmentLettersResponse> publisher) { this.queueConfiguration = queueConfiguration; this.consumer = consumer; this.publisher = publisher; }
public static async Task <SimpleProcessingWorker <T> > CreateAndStartAsync(IQueueConsumer consumer, Action <IEnumerable <T> > batchCallbackAction, ushort batchSize, CancellationToken cancellationToken, ILogger logger = null) { var instance = new SimpleProcessingWorker <T>(consumer, batchCallbackAction, batchSize, logger); await instance.StartAsync(cancellationToken).ConfigureAwait(false); return(instance); }
public AdvancedAsyncProcessingWorker(IQueueConsumer consumer, Func <T, RabbitMQConsumerContext, CancellationToken, Task> callbackFunc, TimeSpan processingTimeout, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0, ILogger logger = null) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, logger) { _callbackFunc = callbackFunc; _processingTimeout = processingTimeout; }
public ServiceRunner( IQueueConfiguration queueConfiguration, IQueueConsumer<ProcessValueInstructionFileAcknowledgmentRequest> createVifFileConsumer, IExchangePublisher<ProcessValueInstructionFileAcknowledgmentResponse> createVifFilePublisher) { this.queueConfiguration = queueConfiguration; this.createVifFileConsumer = createVifFileConsumer; this.createVifFilePublisher = createVifFilePublisher; }
public ServiceRunner( IQueueConfiguration queueConfiguration, IQueueConsumer<MatchVoucherRequest> createVifFileConsumer, IExchangePublisher<MatchVoucherResponse> createVifFilePublisher) { this.queueConfiguration = queueConfiguration; this.createECLFileConsumer = createVifFileConsumer; this.createECLFilePublisher = createVifFilePublisher; }
public ServiceRunner( IOcrProcessingService carService, IAdapterConfiguration adapterConfiguration, IQueueConsumer<RecogniseBatchCourtesyAmountRequest> carRequestQueueConsumer) { this.adapterConfiguration = adapterConfiguration; this.carRequestQueueConsumer = carRequestQueueConsumer; this.carService = carService; }
public AdvancedAsyncProcessingWorker(IQueueConsumer consumer, Func <IEnumerable <T>, CancellationToken, Task> batchCallbackFunc, ushort batchSize, TimeSpan processingTimeout, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0, ILogger logger = null) : base(consumer, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, logger) { _batchCallbackFunc = batchCallbackFunc; _processingTimeout = processingTimeout; _batchSize = batchSize; }
public static void Register(IQueueConsumer consumer) { lock (_locker) { if (!_consumers.Contains(consumer)) { _consumers.Add(consumer); } } }
public Task StartAsync(CancellationToken cancellationToken) { if (Consumer == null) { Consumer = QueueClient.GetConsumer(QueueName, ConsumerCountManager, this, MessageRejectionHandler); } return(Consumer.StartAsync(cancellationToken)); }
public ServiceRunner( IOutboundConfiguration outboundConfiguration, IQueueConfiguration queueConfiguration, IQueueConsumer<CreateImageExchangeFileRequest> createBatchImageExchangeFileConsumer, IExchangePublisher<CreateImageExchangeFileResponse> createBatchImageExchangeFilePublisher) { this.outboundConfiguration = outboundConfiguration; this.queueConfiguration = queueConfiguration; this.createBatchImageExchangeFileConsumer = createBatchImageExchangeFileConsumer; this.createBatchImageExchangeFilePublisher = createBatchImageExchangeFilePublisher; }
public async Task <string> BasicConsume(ConsumeMode mode, IQueueConsumer consumer, string queue, string consumerTag, bool withoutAcks, bool exclusive, IDictionary <string, object> arguments, bool waitConfirmation) { ThrowIfRecoveryInProcess(); var consumerTag2 = await _channel.BasicConsume(mode, consumer, queue, consumerTag, withoutAcks, exclusive, arguments, waitConfirmation).ConfigureAwait(false); lock (_consumersRegistered) _consumersRegistered.Add(new QueueConsumerRecovery(mode, consumer, queue, consumerTag2, withoutAcks, exclusive, arguments)); return(consumerTag2); }
public ServiceRunner( IA2IAService carService, IAdapterConfiguration adapterConfiguration, IQueueConsumer <RecogniseBatchCourtesyAmountRequest> carRequestQueueConsumer, IExchangePublisher <RecogniseBatchCourtesyAmountResponse> carResponseExchangePublisher) { this.adapterConfiguration = adapterConfiguration; this.carRequestQueueConsumer = carRequestQueueConsumer; this.carResponseExchangePublisher = carResponseExchangePublisher; this.carService = carService; }
public void ReadMessage(RabbitWorkQueues workQueues, IQueueConsumer queueConsumer) { workQueues.Channel = CreateChannel(); workQueues.Consumer = GetConsumer(workQueues.Channel); workQueues.Consumer.Received += (model, ea) => { var content = Encoding.UTF8.GetString(ea.Body); queueConsumer.ProcessMessage(content, ea, (model as IBasicConsumer).Model); }; }
public ServiceRunner( IA2IAService carService, IAdapterConfiguration adapterConfiguration, IQueueConsumer<RecogniseBatchCourtesyAmountRequest> carRequestQueueConsumer, IExchangePublisher<RecogniseBatchCourtesyAmountResponse> carResponseExchangePublisher) { this.adapterConfiguration = adapterConfiguration; this.carRequestQueueConsumer = carRequestQueueConsumer; this.carResponseExchangePublisher = carResponseExchangePublisher; this.carService = carService; }
public UserEventListener( IQueueConsumer <CreateUser> userQueueConsumer, IMessagePublisher messagePublisher, IMapper mapper, ICovidApiHelper covidApiHelper) : base(userQueueConsumer) { _messagePublisher = messagePublisher ?? throw new ArgumentNullException(nameof(messagePublisher)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _covidApiHelper = covidApiHelper ?? throw new ArgumentNullException(nameof(covidApiHelper)); }
public void ReadMessages(IQueueConsumer queueConsumer) { ServicePointManager.DefaultConnectionLimit = _rabbitWorkQueues.Length; System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true); for (int i = 0; i < _rabbitWorkQueues.Length; i++) { this._rabbitWorkQueues[i] = new RabbitWorkQueues(); this._consumer.ReadMessage(this._rabbitWorkQueues[i], queueConsumer); } }
public static async Task <AdvancedProcessingWorker <T> > CreateAndStartAsync(IQueueConsumer consumer, Action <IEnumerable <T> > batchCallbackAction, ushort batchSize, CancellationToken cancellationToken, ExceptionHandlingStrategy exceptionHandlingStrategy = ExceptionHandlingStrategy.Requeue, int invokeRetryCount = 1, int invokeRetryWaitMilliseconds = 0, ILogger logger = null) { var instance = new AdvancedProcessingWorker <T>(consumer, batchCallbackAction, batchSize, exceptionHandlingStrategy, invokeRetryCount, invokeRetryWaitMilliseconds, logger); await instance.StartAsync(cancellationToken).ConfigureAwait(false); return(instance); }
public UserAggregateEventListener( IQueueConsumer <CreateUser3> queueConsumer, IMessagePublisher messagePublisher, IMapper mapper, ICovidApiHelper covidApiHelper) : base(queueConsumer) { _messagePublisher = messagePublisher ?? throw new ArgumentNullException(nameof(messagePublisher)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _covidApiHelper = covidApiHelper ?? throw new ArgumentNullException(nameof(covidApiHelper)); _queueGroups = new Dictionary <string, QueueGroup <CreateUserGroup> >(); }
public ServiceRunner( IAdapterConfiguration adapterConfig, IQueueConsumer<ValidateBatchCodelineRequest> validateCodelineRequestQueue, IExchangePublisher<ValidateBatchCodelineResponse> validateCodelineExchange, IQueueConsumer<CorrectBatchCodelineRequest> correctCodelineRequestQueue, IExchangePublisher<CorrectBatchCodelineResponse> correctCodelineExchange, IQueueConsumer<ValidateBatchTransactionRequest> validateTransactionRequestQueue, IExchangePublisher<ValidateBatchTransactionResponse> validateTransactionExchange, IQueueConsumer<CorrectBatchTransactionRequest> correctTransactionRequestQueue, IExchangePublisher<CorrectBatchTransactionResponse> correctTransactionExchange, IQueueConsumer<CheckThirdPartyBatchRequest> checkThirdPartyRequestQueue, IExchangePublisher<CheckThirdPartyBatchResponse> checkThirdPartyExchange, IQueueConsumer<GenerateCorrespondingVoucherRequest> generateCorrespondingVoucherRequestQueue, IExchangePublisher<GenerateCorrespondingVoucherResponse> generateCorrespondingVoucherExchange, IExchangePublisher<GetVouchersInformationRequest> getVoucherInformationRequestExchange, IQueueConsumer<GetVouchersInformationResponse> getVoucherInformationResponseQueue, IQueueConsumer<GenerateBatchBulkCreditRequest> generateBulkCreditRequestQueue, IExchangePublisher<GenerateBatchBulkCreditResponse> generateBulkCreditResponseExchange, IJobFactory jobFactory, IScheduler scheduler, IQuartzConfiguration quartzConfiguration) { this.adapterConfig = adapterConfig; this.validateCodelineRequestQueue = validateCodelineRequestQueue; this.validateCodelineExchange = validateCodelineExchange; this.correctCodelineRequestQueue = correctCodelineRequestQueue; this.correctCodelineExchange = correctCodelineExchange; this.validateTransactionRequestQueue = validateTransactionRequestQueue; this.validateTransactionExchange = validateTransactionExchange; this.correctTransactionRequestQueue = correctTransactionRequestQueue; this.correctTransactionExchange = correctTransactionExchange; this.checkThirdPartyRequestQueue = checkThirdPartyRequestQueue; this.checkThirdPartyExchange = checkThirdPartyExchange; this.generateCorrespondingVoucherRequestQueue = generateCorrespondingVoucherRequestQueue; this.generateCorrespondingVoucherExchange = generateCorrespondingVoucherExchange; this.getVoucherInformationRequestExchange = getVoucherInformationRequestExchange; this.getVoucherInformationResponseQueue = getVoucherInformationResponseQueue; this.generateBulkCreditRequestQueue = generateBulkCreditRequestQueue; this.generateBulkCreditResponseExchange = generateBulkCreditResponseExchange; this.jobFactory = jobFactory; this.scheduler = scheduler; this.quartzConfiguration = quartzConfiguration; }
public ServiceRunner(IQueueConsumer<DocumentumRequestMessage> documentumRequestQueueConsumer) { this.documentumRequestQueueConsumer = documentumRequestQueueConsumer; }