public async Task Handle(Message message, IBusForHandler bus)
            {
                this.context.AsyncHandlerCalls += 1;
                await bus.Reply(new ReplyMessage { Answer = "AsyncMessageHandler" });

                var options = new ReplyOptions();

                options.Headers.Add("Key", "Value");
                await bus.Reply(new ReplyMessage { Answer = "AsyncMessageHandlerWithHeaders" }, options);
            }
Пример #2
0
 public void Handle(Message message, IBusForHandler bus)
 {
     this.context.HandlerCalled();
     bus.Reply(new ReplyMessage {
         Answer = "MessageHandler"
     }).Wait();
 }
Пример #3
0
 public Task Handle(Message message, IBusForHandler bus)
 {
     context.SecondHandlerCalls += 1;
     return(bus.Reply(new ReplyMessage
     {
         Answer = "SecondHandler"
     }));
 }
Пример #4
0
            public async Task Handle(Message message, IBusForHandler bus)
            {
                this.context.AsyncHandlerCalled();

                await bus.Reply(new ReplyMessage { Bar = message.Bar });

                if (message.Throw)
                {
                    throw new InvalidOperationException();
                }
            }
Пример #5
0
 public async Task Handle(Message message, IBusForHandler bus)
 {
     this.context.AsyncHandlerCalled();
     await bus.Reply(new ReplyMessage { Answer = "AsyncMessageHandler" });
 }