コード例 #1
0
        public void Execute(Envelope envelope, ContinuationContext context)
        {
            context.Outgoing.SendOutgoingMessages(envelope, _context.OutgoingMessages());

            envelope.Callback.MarkSuccessful();
            context.Logger.InfoMessage(() => new MessageSuccessful {Envelope = envelope.ToToken()});
        }
コード例 #2
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     context.Logger.InfoMessage(() => new MessageSuccessful {
         Envelope = envelope.ToToken()
     });
     envelope.Callback.MarkSuccessful();
 }
コード例 #3
0
        public void Execute(Envelope envelope, ContinuationContext context)
        {
            context.Outgoing.SendFailureAcknowledgement(envelope, "Moved message {0} to the Error Queue.\n{1}".ToFormat(envelope.CorrelationId, _exception));

            var report = new ErrorReport(envelope, _exception);
            envelope.Callback.MoveToErrors(report);
        }
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     envelope.Message = null; // Prevent the error from throwing again.
     context.SendFailureAcknowledgement(envelope, "Deserialization failed");
     context.Logger.Error(envelope.CorrelationId, _exception.Message, _exception);
     envelope.Callback.MoveToErrors(new ErrorReport(envelope, _exception));
 }
コード例 #5
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     envelope.Message = null; // Prevent the error from throwing again.
     context.SendFailureAcknowledgement(envelope, "Deserialization failed");
     context.Logger.Error(envelope.CorrelationId, _exception.Message, _exception);
     envelope.Callback.MoveToErrors(new ErrorReport(envelope, _exception));
 }
コード例 #6
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     _task = Task.Factory.StartNew(() => {
         var continuation = _inner();
         continuation.Execute(envelope, context);
     });
 }
コード例 #7
0
        public HandlerPipeline(IEnvelopeSerializer serializer, ContinuationContext context,
            IEnumerable<IEnvelopeHandler> handlers)
        {
            _serializer = serializer;
            _context = context;
            _handlers.AddRange(handlers);

            // needs to be available to continuations
            _context.Pipeline = this;
        }
コード例 #8
0
        public HandlerPipeline(IEnvelopeSerializer serializer, ContinuationContext context,
                               IEnumerable <IEnvelopeHandler> handlers)
        {
            _serializer = serializer;
            _context    = context;
            _handlers.AddRange(handlers);

            // needs to be available to continuations
            _context.Pipeline = this;
        }
コード例 #9
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     try
     {
         envelope.Callback.MoveToDelayedUntil(envelope.ExecutionTime.Value);
         context.Logger.InfoMessage(() => new DelayedEnvelopeReceived { Envelope = envelope.ToToken() });
     }
     catch (Exception e)
     {
         envelope.Callback.MarkFailed(e);
         context.Logger.Error(envelope.CorrelationId, "Failed to move delayed message to the delayed message queue", e);
     }
 }
コード例 #10
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     _continuations.Each(x => {
         try
         {
             x.Execute(envelope, context);
         }
         catch (Exception e)
         {
             context.Logger.Error("Failed trying to run continuation {0} as part of error handling".ToFormat(x), e);
         }
     });
 }
コード例 #11
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     context.SendFailureAcknowledgement(envelope, "Chain execution failed");
     envelope.Callback.MarkFailed(_exception);
     context.Logger.InfoMessage(() => new MessageFailed {Envelope = envelope.ToToken(), Exception = _exception});
     if (envelope.Message == null)
     {
         context.Logger.Error(envelope.CorrelationId, "Error trying to execute a message of type " + envelope.Headers[Envelope.MessageTypeKey], _exception);
     }
     else
     {
         context.Logger.Error(envelope.CorrelationId, envelope.Message.ToString(), _exception);
     }
 }
コード例 #12
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     try
     {
         envelope.Callback.MoveToDelayedUntil(envelope.ExecutionTime.Value);
         context.Logger.InfoMessage(() => new DelayedEnvelopeReceived {
             Envelope = envelope.ToToken()
         });
     }
     catch (Exception e)
     {
         envelope.Callback.MarkFailed(e);
         context.Logger.Error(envelope.CorrelationId, "Failed to move delayed message to the delayed message queue", e);
     }
 }
コード例 #13
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     context.SendFailureAcknowledgement(envelope, "Chain execution failed");
     envelope.Callback.MarkFailed(_exception);
     context.Logger.InfoMessage(() => new MessageFailed {
         Envelope = envelope.ToToken(), Exception = _exception
     });
     if (envelope.Message == null)
     {
         context.Logger.Error(envelope.CorrelationId, "Error trying to execute a message of type " + envelope.Headers[Envelope.MessageTypeKey], _exception);
     }
     else
     {
         context.Logger.Error(envelope.CorrelationId, envelope.Message.ToString(), _exception);
     }
 }
コード例 #14
0
        public void Execute(Envelope envelope, ContinuationContext context)
        {
            try
            {
                context.SendOutgoingMessages(envelope, _context.OutgoingMessages());

                envelope.Callback.MarkSuccessful();

                var message = new MessageSuccessful { Envelope = envelope.ToToken() };
                if (!message.Envelope.IsDelayedEnvelopePollingJobRelated())
                    context.Logger.InfoMessage(message);
            }
            catch (Exception ex)
            {
                context.SendFailureAcknowledgement(envelope, "Sending cascading message failed: " + ex.Message);
                context.Logger.Error(envelope.CorrelationId, ex.Message, ex);
                envelope.Callback.MoveToErrors(new ErrorReport(envelope, ex));
            }
        }
コード例 #15
0
        public void Execute(Envelope envelope, ContinuationContext context)
        {
            try
            {
                context.SendOutgoingMessages(envelope, _context.OutgoingMessages());

                envelope.Callback.MarkSuccessful();

                var message = new MessageSuccessful {
                    Envelope = envelope.ToToken()
                };
                if (!message.Envelope.IsDelayedEnvelopePollingJobRelated())
                {
                    context.Logger.InfoMessage(message);
                }
            }
            catch (Exception ex)
            {
                context.SendFailureAcknowledgement(envelope, "Sending cascading message failed: " + ex.Message);
                context.Logger.Error(envelope.CorrelationId, ex.Message, ex);
                envelope.Callback.MoveToErrors(new ErrorReport(envelope, ex));
            }
        }
コード例 #16
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     ++Counter;
 }
コード例 #17
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     context.SendFailureAcknowledgement(envelope, "No subscriber");
     envelope.Callback.MarkSuccessful();
     // TODO -- do more here.  There's a GH issue for this.
 }
コード例 #18
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     context.Logger.InfoMessage(() => new MessageSuccessful { Envelope = envelope.ToToken() });
     envelope.Callback.MarkSuccessful();
 }
コード例 #19
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     envelope.Callback.MoveToDelayedUntil(context.SystemTime.UtcNow().Add(_delay));
 }
コード例 #20
0
 public abstract void Execute(Envelope envelope, ContinuationContext context);
コード例 #21
0
 public override void Execute(Envelope envelope, ContinuationContext context)
 {
     context.SendFailureAcknowledgement(envelope, "No subscriber");
     envelope.Callback.MarkSuccessful();
     // TODO -- do more here.  There's a GH issue for this.
 }
コード例 #22
0
 public abstract void Execute(Envelope envelope, ContinuationContext context);
コード例 #23
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     envelope.Callback.Requeue();
 }
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     throw new NotImplementedException();
 }
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     context.Outgoing.SendFailureAcknowledgement(envelope, "Deserialization failed");
     context.Logger.Error(envelope.CorrelationId, _exception.Message, _exception);
     envelope.Callback.MoveToErrors(new ErrorReport(envelope, _exception));
 }
コード例 #26
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     context.SendOutgoingMessages(envelope, new[] { Message });
 }
コード例 #27
0
 public void Execute(Envelope envelope, ContinuationContext context)
 {
     context.Pipeline.Invoke(envelope);
 }