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); }
public void Handle(Message message, IBusForHandler bus) { this.context.HandlerCalled(); bus.Reply(new ReplyMessage { Answer = "MessageHandler" }).Wait(); }
public Task Handle(Message message, IBusForHandler bus) { context.SecondHandlerCalls += 1; return(bus.Reply(new ReplyMessage { Answer = "SecondHandler" })); }
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(); } }
public async Task Handle(Message message, IBusForHandler bus) { this.context.AsyncHandlerCalled(); await bus.Reply(new ReplyMessage { Answer = "AsyncMessageHandler" }); }