Esempio n. 1
0
 private void ProcessSingleMessage(IInboundMessage message)
 {
     _inboundMessageProcessor.TryDeserializeAndProcess(
         message,
         _errorPolicy,
         deserializedMessage =>
     {
         using (var scope = _serviceProvider.CreateScope())
         {
             RelayAndCommitSingleMessage(deserializedMessage, scope.ServiceProvider);
         }
     });
 }
Esempio n. 2
0
        private void ProcessBatch()
        {
            try
            {
                _inboundMessageProcessor.TryDeserializeAndProcess(
                    new InboundBatch(CurrentBatchId, _messages, _endpoint),
                    _errorPolicy,
                    deserializedBatch => ProcessEachMessageAndPublishEvents((IInboundBatch)deserializedBatch));

                _messages.Clear();
            }
            catch (Exception ex)
            {
                _processingException = ex;
                throw new SilverbackException("Failed to process batch. See inner exception for details.", ex);
            }
        }