static Task Publish(IBehaviorContext context, Type messageType, object message, PublishOptions options) { var cache = context.Extensions.Get <IPipelineCache>(); var pipeline = cache.Pipeline <IOutgoingPublishContext>(); var publishContext = new OutgoingPublishContext( new OutgoingLogicalMessage(messageType, message), options, context); return(pipeline.Invoke(publishContext)); }
public static Task Publish(IBehaviorContext context, object message, PublishOptions options) { var settings = context.Builder.Build <ReadOnlySettings>(); var pipeline = new PipelineBase <IOutgoingPublishContext>( context.Builder, settings, settings.Get <PipelineConfiguration>().MainPipeline); var publishContext = new OutgoingPublishContext( new OutgoingLogicalMessage(message), options, context); return(pipeline.Invoke(publishContext)); }
static Task Publish(IBehaviorContext context, Type messageType, object message, PublishOptions options) { var messageId = options.UserDefinedMessageId ?? CombGuid.Generate().ToString(); var headers = new Dictionary <string, string>(options.OutgoingHeaders) { [Headers.MessageId] = messageId }; var publishContext = new OutgoingPublishContext( new OutgoingLogicalMessage(messageType, message), messageId, headers, options.Context, context); return(publishContext.InvokePipeline <IOutgoingPublishContext>()); }