public Task Invoke(OutgoingLogicalContext context, Func<Task> next) { DeliveryOptions options = context.Options; var toSend = new TransportMessage { MessageIntent = MessageIntent.Publish }; var sendOptions = options as SendOptions; if (sendOptions != null) { toSend.MessageIntent = sendOptions is ReplyOptions ? MessageIntent.Reply : MessageIntent.Send; toSend.ReplyTo = sendOptions.ReplyToAddress; if (sendOptions.CorrelationId != null) { toSend.CorrelationId = sendOptions.CorrelationId; } } foreach (var headerEntry in context.LogicalMessage.Headers) { toSend.Headers[headerEntry.Key] = headerEntry.Value; } context.Set(toSend); return next(); }
public Task Invoke(OutgoingLogicalContext context, Func <Task> next) { DeliveryOptions options = context.Options; var toSend = new TransportMessage { MessageIntent = MessageIntent.Publish }; var sendOptions = options as SendOptions; if (sendOptions != null) { toSend.MessageIntent = sendOptions is ReplyOptions ? MessageIntent.Reply : MessageIntent.Send; toSend.ReplyTo = sendOptions.ReplyToAddress; if (sendOptions.CorrelationId != null) { toSend.CorrelationId = sendOptions.CorrelationId; } } foreach (var headerEntry in context.LogicalMessage.Headers) { toSend.Headers[headerEntry.Key] = headerEntry.Value; } context.Set(toSend); return(next()); }
Task InvokeLogical(OutgoingLogicalContext context) { if (executingLogicalPipeline.Count == 0) { return(Task.FromResult(0)); } IOutgoingLogicalStep step = executingLogicalPipeline.Dequeue(); return(step.Invoke(context, () => InvokeLogical(context))); }
public virtual async Task Invoke(LogicalMessage outgoingLogicalMessage, DeliveryOptions options, EndpointConfiguration.ReadOnly configuration, TransportMessage incomingTransportMessage = null) { executingLogicalPipeline = new Queue<IOutgoingLogicalStep>(registeredlogicalPipelineSteps); var logicalContext = new OutgoingLogicalContext(outgoingLogicalMessage, options, configuration); await InvokeLogical(logicalContext) .ConfigureAwait(false); // We assume that someone in the pipeline made transport message var outgoingTransportMessage = logicalContext.Get<TransportMessage>(); executingTransportPipeline = new Queue<IOutgoingTransportStep>(registeredTransportPipelineSteps); var transportContext = new OutgoingTransportContext(outgoingLogicalMessage, outgoingTransportMessage, options, configuration, incomingTransportMessage); await InvokeTransport(transportContext) .ConfigureAwait(false); }
public virtual async Task Invoke(LogicalMessage outgoingLogicalMessage, DeliveryOptions options, EndpointConfiguration.ReadOnly configuration, TransportMessage incomingTransportMessage = null) { executingLogicalPipeline = new Queue <IOutgoingLogicalStep>(registeredlogicalPipelineSteps); var logicalContext = new OutgoingLogicalContext(outgoingLogicalMessage, options, configuration); await InvokeLogical(logicalContext) .ConfigureAwait(false); // We assume that someone in the pipeline made transport message var outgoingTransportMessage = logicalContext.Get <TransportMessage>(); executingTransportPipeline = new Queue <IOutgoingTransportStep>(registeredTransportPipelineSteps); var transportContext = new OutgoingTransportContext(outgoingLogicalMessage, outgoingTransportMessage, options, configuration, incomingTransportMessage); await InvokeTransport(transportContext) .ConfigureAwait(false); }
Task InvokeLogical(OutgoingLogicalContext context) { if (executingLogicalPipeline.Count == 0) { return Task.FromResult(0); } IOutgoingLogicalStep step = executingLogicalPipeline.Dequeue(); return step.Invoke(context, () => InvokeLogical(context)); }
public Task Invoke(OutgoingLogicalContext context, Func<Task> next) { var step = factory(); return step.Invoke(context, next); }
public Task Invoke(OutgoingLogicalContext context, Func<Task> next) { collector.Add(context.LogicalMessage); return next(); }
public Task Invoke(OutgoingLogicalContext context, Func <Task> next) { var step = factory(); return(step.Invoke(context, next)); }