public void EnqueueOperation(BasicSerializedDeliveryEventArgs<FileMessage> operation) { if (operation == null) { throw new ArgumentNullException("operation"); } this.GuardDisposed(); _logger.Trace("[Start]: Harvester [{0}] enqueue operation with message ID {1}", _harvesterName, operation.BasicProperties.MessageId); lock (_syncObject) { _operationQueue.Enqueue(operation); Monitor.Pulse(_syncObject); } _logger.Trace("[End]: Harvester [{0}] enqueue operation with message ID {1}", _harvesterName, operation.BasicProperties.MessageId); }
public void EnqueueOperation(BasicSerializedDeliveryEventArgs<FileMessage> operation) { this.GuardDisposed(); if (operation == null) { throw new ArgumentNullException("operation"); } lock (_syncObject) { IHarvesterProcessingDispatcher harvesterDispatcher; string harvesterName = operation.Body.Harvester; if (!_harvesterProcessingDispatchers.TryGetValue(harvesterName, out harvesterDispatcher)) { harvesterDispatcher = _harvesterDispatcherFactory.Create(harvesterName); _harvesterProcessingDispatchers.Add(harvesterName, harvesterDispatcher); } harvesterDispatcher.EnqueueOperation(operation); } }
private void ConsumerOnReceived(object sender, BasicSerializedDeliveryEventArgs<FileMessage> basicSerializedDeliveryEventArgs) { _fileMessageDispatcher.EnqueueOperation(basicSerializedDeliveryEventArgs); }