public void Reply(params object[] messages) { var options = SendOptions.ReplyTo(MessageBeingProcessed.ReplyToAddress); options.CorrelationId = !string.IsNullOrEmpty(MessageBeingProcessed.CorrelationId) ? MessageBeingProcessed.CorrelationId : MessageBeingProcessed.Id; SendMessages(options, LogicalMessageFactory.CreateMultiple(messages)); }
public void Return <T>(T errorCode) { var returnMessage = ControlMessage.Create(Address.Local); returnMessage.MessageIntent = MessageIntentEnum.Reply; returnMessage.Headers[Headers.ReturnMessageErrorCodeHeader] = errorCode.GetHashCode().ToString(); returnMessage.CorrelationId = !string.IsNullOrEmpty(MessageBeingProcessed.CorrelationId) ? MessageBeingProcessed.CorrelationId : MessageBeingProcessed.Id; var options = SendOptions.ReplyTo(MessageBeingProcessed.ReplyToAddress); PipelineFactory.InvokeSendPipeline(options, returnMessage); }
public void Return <T>(T errorCode) { TransportMessage returnMessage; if (Configure.Instance.WorkerRunsOnThisEndpoint()) { returnMessage = ControlMessage.Create(MasterNodeAddress); } else { returnMessage = ControlMessage.Create(Address.Local); } returnMessage.MessageIntent = MessageIntentEnum.Reply; returnMessage.Headers[Headers.ReturnMessageErrorCodeHeader] = errorCode.GetHashCode().ToString(); returnMessage.CorrelationId = !string.IsNullOrEmpty(MessageBeingProcessed.CorrelationId) ? MessageBeingProcessed.CorrelationId : MessageBeingProcessed.Id; var options = SendOptions.ReplyTo(MessageBeingProcessed.ReplyToAddress); PipelineFactory.InvokeSendPipeline(options, returnMessage); }