public void Execute(Envelope envelope, ContinuationContext context) { context.Outgoing.SendOutgoingMessages(envelope, _context.OutgoingMessages()); envelope.Callback.MarkSuccessful(); context.Logger.InfoMessage(() => new MessageSuccessful {Envelope = envelope.ToToken()}); }
public override void Execute(Envelope envelope, ContinuationContext context) { context.Logger.InfoMessage(() => new MessageSuccessful { Envelope = envelope.ToToken() }); envelope.Callback.MarkSuccessful(); }
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)); }
public void Execute(Envelope envelope, ContinuationContext context) { _task = Task.Factory.StartNew(() => { var continuation = _inner(); continuation.Execute(envelope, context); }); }
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; }
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; }
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); } }
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); } }); }
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); } }
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); } }
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)); } }
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)); } }
public void Execute(Envelope envelope, ContinuationContext context) { ++Counter; }
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. }
public void Execute(Envelope envelope, ContinuationContext context) { envelope.Callback.MoveToDelayedUntil(context.SystemTime.UtcNow().Add(_delay)); }
public abstract void Execute(Envelope envelope, ContinuationContext context);
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)); }
public void Execute(Envelope envelope, ContinuationContext context) { context.SendOutgoingMessages(envelope, new[] { Message }); }
public void Execute(Envelope envelope, ContinuationContext context) { context.Pipeline.Invoke(envelope); }