diff --git a/src/Services/Basket/Basket.API/Events/CatalogPriceChangedHandler.cs b/src/Services/Basket/Basket.API/Events/CatalogPriceChangedHandler.cs index 006c82119..280692c17 100644 --- a/src/Services/Basket/Basket.API/Events/CatalogPriceChangedHandler.cs +++ b/src/Services/Basket/Basket.API/Events/CatalogPriceChangedHandler.cs @@ -8,15 +8,15 @@ using System.Threading.Tasks; namespace Basket.API.Events { - public class CatalogPriceChangedHandler : IIntegrationEventHandler + public class ProductPriceChangedHandler : IIntegrationEventHandler { private readonly IBasketRepository _repository; - public CatalogPriceChangedHandler(IBasketRepository repository) + public ProductPriceChangedHandler(IBasketRepository repository) { _repository = repository; } - public async Task Handle(CatalogPriceChanged @event) + public async Task Handle(ProductPriceChanged @event) { var userIds = await _repository.GetUsers(); foreach (var id in userIds) diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index e0bc9c076..ec5141de3 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -79,16 +79,16 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }); services.AddTransient(); - services.AddTransient, CatalogPriceChangedHandler>(); + services.AddTransient, ProductPriceChangedHandler>(); var serviceProvider = services.BuildServiceProvider(); var configuration = serviceProvider.GetRequiredService>().Value; - var eventBus = new EventBus(configuration.EventBusConnection); + var eventBus = new EventBusRabbitMQ(configuration.EventBusConnection); services.AddSingleton(eventBus); - var catalogPriceHandler = serviceProvider.GetService>(); - eventBus.Subscribe(catalogPriceHandler); + var catalogPriceHandler = serviceProvider.GetService>(); + eventBus.Subscribe(catalogPriceHandler); } diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index 71dcd5d1e..2909b141c 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -149,7 +149,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers _context.CatalogItems.Update(item); await _context.SaveChangesAsync(); - var @event = new CatalogPriceChanged(item.Id, item.Price, oldPrice); + var @event = new ProductPriceChanged(item.Id, item.Price, oldPrice); await ProcessEventAsync(@event); } diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 9e0da8d00..cb4f6254c 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -77,7 +77,7 @@ var serviceProvider = services.BuildServiceProvider(); var configuration = serviceProvider.GetRequiredService>().Value; - services.AddSingleton(new EventBus(configuration.EventBusConnection)); + services.AddSingleton(new EventBusRabbitMQ(configuration.EventBusConnection)); services.AddMvc(); } diff --git a/src/Services/Common/Infrastructure/Catalog/CatalogPriceChanged.cs b/src/Services/Common/Infrastructure/Catalog/ProductPriceChanged.cs similarity index 78% rename from src/Services/Common/Infrastructure/Catalog/CatalogPriceChanged.cs rename to src/Services/Common/Infrastructure/Catalog/ProductPriceChanged.cs index 2c31a85b6..4f28d4b1f 100644 --- a/src/Services/Common/Infrastructure/Catalog/CatalogPriceChanged.cs +++ b/src/Services/Common/Infrastructure/Catalog/ProductPriceChanged.cs @@ -4,7 +4,7 @@ using System.Text; namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure.Catalog { - public class CatalogPriceChanged : IntegrationEventBase + public class ProductPriceChanged : IntegrationEventBase { public int ItemId { get; private set; } @@ -12,7 +12,7 @@ namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure.Catalog public decimal OldPrice { get; set; } - public CatalogPriceChanged(int itemId, decimal newPrice, decimal oldPrice) + public ProductPriceChanged(int itemId, decimal newPrice, decimal oldPrice) { ItemId = itemId; NewPrice = newPrice; diff --git a/src/Services/Common/Infrastructure/EventBus.cs b/src/Services/Common/Infrastructure/EventBusRabbitMQ.cs similarity index 98% rename from src/Services/Common/Infrastructure/EventBus.cs rename to src/Services/Common/Infrastructure/EventBusRabbitMQ.cs index 4ff33e79b..aa17553a7 100644 --- a/src/Services/Common/Infrastructure/EventBus.cs +++ b/src/Services/Common/Infrastructure/EventBusRabbitMQ.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure { - public class EventBus : IEventBus + public class EventBusRabbitMQ : IEventBus { private readonly string _brokerName = "event_bus"; private readonly string _connectionString; @@ -24,7 +24,7 @@ namespace Microsoft.eShopOnContainers.Services.Common.Infrastructure private string _queueName; - public EventBus(string connectionString) + public EventBusRabbitMQ(string connectionString) { _connectionString = connectionString; _handlers = new Dictionary>();