示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }