public void Execute(Envelope envelope, IEnvelopeContext context) { try { context.SendOutgoingMessages(envelope, _context.OutgoingMessages()); envelope.Callback.MarkSuccessful(); var message = new MessageSuccessful { Envelope = envelope.ToToken() }; if (!message.Envelope.IsDelayedEnvelopePollingJobRelated()) context.InfoMessage(message); } catch (Exception ex) { context.SendFailureAcknowledgement(envelope, "Sending cascading message failed: " + ex.Message); context.Error(envelope.CorrelationId, ex.Message, ex); envelope.Callback.MoveToErrors(new ErrorReport(envelope, ex)); } }
public void Execute(Envelope envelope, IEnvelopeContext context) { try { context.SendOutgoingMessages(envelope, _context.OutgoingMessages()); envelope.Callback.MarkSuccessful(); var message = new MessageSuccessful { Envelope = envelope.ToToken() }; if (!message.Envelope.IsDelayedEnvelopePollingJobRelated()) { context.InfoMessage(message); } } catch (Exception ex) { context.SendFailureAcknowledgement(envelope, "Sending cascading message failed: " + ex.Message); context.Error(envelope.CorrelationId, ex.Message, ex); envelope.Callback.MoveToErrors(new ErrorReport(envelope, ex)); } }
public void Execute(Envelope envelope, IEnvelopeContext context) { context.SendOutgoingMessages(envelope, new[] { Message }); }