public async Task Handle(MyRequest message, IMessageHandlerContext context)
    {
        #region SimpleHandlerV2

        await context.Publish(
            new MyPublishMessage
        {
            Property = "Value"
        });

        await context.Reply(
            new MyReplyMessage
        {
            Property = "Value"
        });

        var sendOptions = new SendOptions();
        sendOptions.DelayDeliveryWith(TimeSpan.FromDays(1));
        await context.Send(
            new MySendMessage
        {
            Property = "Value"
        },
            sendOptions);

        await context.ForwardCurrentMessageTo("newDestination");

        #endregion
    }
    public async Task Handle(MyRequest message, IMessageHandlerContext context)
    {
        await context.Publish(
            new MyPublishMessage
        {
            Property = "Value"
        })
        .ConfigureAwait(false);

        await context.Reply(
            new MyReplyMessage
        {
            Property = "Value"
        })
        .ConfigureAwait(false);

        var sendOptions = new SendOptions();

        sendOptions.DelayDeliveryWith(TimeSpan.FromHours(12));
        await context.Send(
            new MySendMessage
        {
            Property = "Value"
        },
            sendOptions)
        .ConfigureAwait(false);

        await context.ForwardCurrentMessageTo("newDestination")
        .ConfigureAwait(false);
    }
Exemple #3
0
        public async Task Handle(StartsSaga message, IMessageHandlerContext context)
        {
            await ReplyToOriginator(context, new ResponseToOriginator());

            await context.Publish <Event>();

            await context.Send <Command>(s => { });

            await context.ForwardCurrentMessageTo("forwardingDestination");

            await RequestTimeout(context, TimeSpan.FromDays(7), message);
        }
        Usage(EndpointConfiguration endpointConfiguration, IMessageHandlerContext context)
        {
            Task.Run(async() =>
            {
                #region ForwardingMessageFromHandler

                await context.ForwardCurrentMessageTo("destinationQueue@machine")
                .ConfigureAwait(false);

                #endregion
            });
        }
        Usage(EndpointConfiguration endpointConfiguration, IMessageHandlerContext context)
        {
#pragma warning disable 618
            #region ForwardingWithCode
            endpointConfiguration.ForwardReceivedMessagesTo("destinationQueue@machine");
            #endregion
#pragma warning restore 618

            Task.Run(async() =>
            {
                #region ForwardingMessageFromHandler

                await context.ForwardCurrentMessageTo("destinationQueue@machine")
                .ConfigureAwait(false);

                #endregion
            });
        }
 public Task Handle(MessageToForward message, IMessageHandlerContext context)
 {
     Context.ReceivedHeaders = context.MessageHeaders;
     return(context.ForwardCurrentMessageTo("message_forward_receiver"));
 }
 public Task Handle(MessageToForward message, IMessageHandlerContext context)
 {
     testContext.ReceivedHeaders = context.MessageHeaders.ToDictionary(x => x.Key, x => x.Value);
     return(context.ForwardCurrentMessageTo("message_forward_receiver"));
 }
Exemple #8
0
            public async Task Handle(TestMessage message, IMessageHandlerContext context)
            {
                await context.ForwardCurrentMessageTo("dest1");

                await context.ForwardCurrentMessageTo("dest2");
            }
Exemple #9
0
 public Task Handle(TestMessage message, IMessageHandlerContext context)
 {
     return(context.ForwardCurrentMessageTo(destination));
 }