Exemplo n.º 1
0
 /*
  * There is neither a mapping in the ConfigureHowToFindSaga nor IOrderPlannedMessage, nor routing in the app.config for
  * IOrderPlannedMessage message.  the saga use a reply, the NServiceBus handles this for us because it no routing needed (already exits as a hidden info in the context).
  */
 //Step 2 : the saga receives IOrderPlannedMessage from the planner service and then a DispatchOrderCommand sent to Order service
 public async Task Handle(IOrderPlannedMessage message, IMessageHandlerContext context)
 {
     //We send the DispatchOrderCommand. This time it's routed in the app.config, i.e. to eCommerce.Order service.
     //The message only contains what Dispatch needs to know.
     logger.Info(message: $"Order {Data.OrderId} has been planned. Sending dispatch command.");
     await context.Send(new DispatchOrderCommand { AddressTo = Data.AddressTo, Weight = Data.Weight });
 }
Exemplo n.º 2
0
 public async Task Handle(IOrderPlannedMessage message, IMessageHandlerContext context)
 {
     Logger.InfoFormat("Order {0} has been planned. Sending dispatch command.",
                       Data.OrderId);
     await context.Send(new DispatchOrderCommand
     {
         AddressTo = Data.AddressTo,
         Weight    = Data.Weight
     });
 }
 public void Handle(IOrderPlannedMessage message)
 {
     Logger.InfoFormat("Order {0} has been planned. Sending dispatch command.",
                       Data.OrderId);
     Bus.Send(new DispatchOrderCommand
     {
         AddressTo = Data.AddressTo,
         Weight    = Data.Weight
     });
 }