Inheritance: OutgoingContext, IOutgoingPublishContext
Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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>());
        }