public async Task Handle(DispatchOrderToDhlFailure message, IMessageHandlerContext context)
        {
            // depending on notify web service, we can retry
            // notify on failure
            // timeout to retry later
            // and so on

            Console.WriteLine("Dispatch Order: {0} and DispatchId: {1} failed with DHL", message.OrderId, message.DispatchId);

            // do some shipping related logic
            Console.WriteLine("Dispatch Order: {0} to Fedex ", message.OrderId);

            var customerNumber = new Guid("f64bb7b3-fb1c-486e-b745-8062bf30e4d3");

            var dispatchOrderToFedex = new DispatchOrderToFedex
            {
                CountryCode         = Data.CountryCode,
                OrderId             = message.OrderId,
                FedexCustomerNumber = customerNumber,
                DispatchId          = Guid.NewGuid(),
                ThrowException      = !Data.ThrowException, //reverse the failure for Fedex
            };

            //Dispatch the order to Fedex
            await context.Send(dispatchOrderToFedex)
            .ConfigureAwait(false);
        }
Esempio n. 2
0
        public void Handle(DispatchOrderToDhlFailure message)
        {
            // depending on notify web service, we can retry
            // notify on failure
            // timeout to retry later
            // and so on

            Console.WriteLine("Dispatch Order: {0} and DispatchId: {1} failed ", message.OrderId, message.DispatchId);
        }