public void Handle(ShipOrder message) { Data.OrderId = message.OrderId; Console.Out.WriteLine($"Order {message.OrderId} is shipping"); ShipOrder(new ShipFinalOrderFedex()); //todo: should set timeout for when FedEx never comes back (i.e. command ends up in error queue) }
public async Task Handle(ShipOrder message, IMessageHandlerContext context) { log.Info($"ShipOrderWorkflow for Order [{Data.OrderId}] - Trying Maple first."); // Execute order to ship with Maple await context.Send(new ShipWithMaple() { OrderId = Data.OrderId }); // Add timeout to escalate if Maple did not ship in time. await RequestTimeout(context, TimeSpan.FromSeconds(20), new ShippingEscalation()); }