From b88c15abe35f40aee15594b4d04f9d54a2680a6b Mon Sep 17 00:00:00 2001 From: Christian Arenas Date: Thu, 11 May 2017 18:41:34 +0200 Subject: [PATCH] Remove old integration event call from OrderStockConfirmedIntegrationEventHandler --- .../OrderStockConfirmedIntegrationEventHandler.cs | 10 ---------- .../OrderStockNotConfirmedIntegrationEventHandler.cs | 4 ---- 2 files changed, 14 deletions(-) diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs index cfc2fdbe0..a78a4dda8 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs @@ -22,20 +22,10 @@ public async Task Handle(OrderStockConfirmedIntegrationEvent @event) { - //TODO: 1) Updates the state to "StockValidated" and any meaningful OrderContextDescription message saying that all the items were confirmed with available stock, etc var order = await _orderRepository.GetAsync(@event.OrderId); CheckValidSagaId(order); order.SetOrderStockConfirmed(); - - //Create Integration Event to be published through the Event Bus - var payOrderCommandMsg = new PayOrderCommandMsg(order.Id); - - // Achieving atomicity between original Catalog database operation and the IntegrationEventLog thanks to a local transaction - await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg); - - // Publish through the Event Bus and mark the saved event as published - await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg); } private void CheckValidSagaId(Order orderSaga) diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockNotConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockNotConfirmedIntegrationEventHandler.cs index 04c9babb0..6c210b5af 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockNotConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockNotConfirmedIntegrationEventHandler.cs @@ -34,10 +34,6 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling .Select(c => c.ProductId); orderToUpdate.SetOrderStockConfirmed(orderStockNotConfirmedItems); - - var payOrderCommandMsg = new PayOrderCommandMsg(orderToUpdate.Id); - await _orderingIntegrationEventService.SaveEventAndOrderingContextChangesAsync(payOrderCommandMsg); - await _orderingIntegrationEventService.PublishThroughEventBusAsync(payOrderCommandMsg); } private void CheckValidSagaId(Order orderSaga)