Browse Source

Remove Program from Catalog.API

davidfowl/common-services
Reuben Bond 1 year ago
parent
commit
3f5f0b94ed
21 changed files with 58 additions and 61 deletions
  1. +1
    -1
      src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs
  2. +2
    -2
      src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs
  3. +4
    -0
      src/Services/Catalog/Catalog.API/Catalog.API.csproj
  4. +2
    -2
      src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs
  5. +2
    -2
      src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs
  6. +2
    -2
      src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs
  7. +2
    -18
      src/Services/Catalog/Catalog.API/Program.cs
  8. +30
    -21
      src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs
  9. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs
  10. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs
  11. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs
  12. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs
  13. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs
  14. +1
    -1
      src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs
  15. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs
  16. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs
  17. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs
  18. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs
  19. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs
  20. +1
    -1
      src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs
  21. +1
    -1
      src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs

+ 1
- 1
src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs View File

@ -17,7 +17,7 @@ public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandl
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}")) using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}"))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, @event);
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
var userIds = _repository.GetUsers(); var userIds = _repository.GetUsers();


+ 2
- 2
src/Services/Basket/Basket.FunctionalTests/Base/BasketScenarioBase.cs View File

@ -9,7 +9,7 @@ public class BasketScenarioBase
public TestServer CreateServer() public TestServer CreateServer()
{ {
var factory = new BasketApplicaton();
var factory = new BasketApplication();
return factory.Server; return factory.Server;
} }
@ -27,7 +27,7 @@ public class BasketScenarioBase
public static string CheckoutOrder = $"{ApiUrlBase}/checkout"; public static string CheckoutOrder = $"{ApiUrlBase}/checkout";
} }
private class BasketApplicaton : WebApplicationFactory<Program>
private class BasketApplication : WebApplicationFactory<Program>
{ {
protected override IHost CreateHost(IHostBuilder builder) protected override IHost CreateHost(IHostBuilder builder)
{ {


+ 4
- 0
src/Services/Catalog/Catalog.API/Catalog.API.csproj View File

@ -37,6 +37,10 @@
<None Remove="@(Protobuf)" /> <None Remove="@(Protobuf)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Catalog.FunctionalTests"/>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" />
<PackageReference Include="Azure.Identity" /> <PackageReference Include="Azure.Identity" />


+ 2
- 2
src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs View File

@ -26,7 +26,7 @@ public class CatalogIntegrationEventService : ICatalogIntegrationEventService, I
{ {
try try
{ {
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt);
_logger.LogInformation("----- Publishing integration event: {IntegrationEventId_published} - ({@IntegrationEvent})", evt.Id, evt);
await _eventLogService.MarkEventAsInProgressAsync(evt.Id); await _eventLogService.MarkEventAsInProgressAsync(evt.Id);
_eventBus.Publish(evt); _eventBus.Publish(evt);
@ -34,7 +34,7 @@ public class CatalogIntegrationEventService : ICatalogIntegrationEventService, I
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} from {AppName} - ({@IntegrationEvent})", evt.Id, Program.AppName, evt);
_logger.LogError(ex, "ERROR Publishing integration event: {IntegrationEventId} - ({@IntegrationEvent})", evt.Id, evt);
await _eventLogService.MarkEventAsFailedAsync(evt.Id); await _eventLogService.MarkEventAsFailedAsync(evt.Id);
} }
} }


+ 2
- 2
src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs View File

@ -19,9 +19,9 @@ public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler :
public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>(); var confirmedOrderStockItems = new List<ConfirmedOrderStockItem>();


+ 2
- 2
src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs View File

@ -16,9 +16,9 @@ public class OrderStatusChangedToPaidIntegrationEventHandler :
public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
//we're not blocking stock/inventory //we're not blocking stock/inventory
foreach (var orderStockItem in @event.OrderStockItems) foreach (var orderStockItem in @event.OrderStockItems)


+ 2
- 18
src/Services/Catalog/Catalog.API/Program.cs View File

@ -41,11 +41,8 @@ var eventBus = app.Services.GetRequiredService<IEventBus>();
eventBus.Subscribe<OrderStatusChangedToAwaitingValidationIntegrationEvent, OrderStatusChangedToAwaitingValidationIntegrationEventHandler>(); eventBus.Subscribe<OrderStatusChangedToAwaitingValidationIntegrationEvent, OrderStatusChangedToAwaitingValidationIntegrationEventHandler>();
eventBus.Subscribe<OrderStatusChangedToPaidIntegrationEvent, OrderStatusChangedToPaidIntegrationEventHandler>(); eventBus.Subscribe<OrderStatusChangedToPaidIntegrationEvent, OrderStatusChangedToPaidIntegrationEventHandler>();
try
using (var scope = app.Services.CreateScope())
{ {
app.Logger.LogInformation("Configuring web host ({ApplicationContext})...", AppName);
using var scope = app.Services.CreateScope();
var context = scope.ServiceProvider.GetRequiredService<CatalogContext>(); var context = scope.ServiceProvider.GetRequiredService<CatalogContext>();
var settings = app.Services.GetService<IOptions<CatalogSettings>>(); var settings = app.Services.GetService<IOptions<CatalogSettings>>();
var logger = app.Services.GetService<ILogger<CatalogContextSeed>>(); var logger = app.Services.GetService<ILogger<CatalogContextSeed>>();
@ -54,19 +51,6 @@ try
await new CatalogContextSeed().SeedAsync(context, app.Environment, settings, logger); await new CatalogContextSeed().SeedAsync(context, app.Environment, settings, logger);
var integEventContext = scope.ServiceProvider.GetRequiredService<IntegrationEventLogContext>(); var integEventContext = scope.ServiceProvider.GetRequiredService<IntegrationEventLogContext>();
await integEventContext.Database.MigrateAsync(); await integEventContext.Database.MigrateAsync();
app.Logger.LogInformation("Starting web host ({ApplicationName})...", AppName);
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
app.Logger.LogCritical(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
return 1;
} }
public partial class Program
{
public static string Namespace = typeof(Program).Assembly.GetName().Name;
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
}
await app.RunAsync();

+ 30
- 21
src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs View File

@ -2,36 +2,45 @@
namespace Catalog.FunctionalTests; namespace Catalog.FunctionalTests;
public class CatalogScenariosBase : WebApplicationFactory<Program>
public class CatalogScenariosBase
{ {
public TestServer CreateServer() public TestServer CreateServer()
{ {
Services
.MigrateDbContext<CatalogContext>((context, services) =>
{
var env = services.GetService<IWebHostEnvironment>();
var settings = services.GetService<IOptions<CatalogSettings>>();
var logger = services.GetService<ILogger<CatalogContextSeed>>();
new CatalogContextSeed()
.SeedAsync(context, env, settings, logger)
.Wait();
})
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
return Server;
var factory = new CatalogApplication();
return factory.CreateServer();
} }
protected override IHost CreateHost(IHostBuilder builder)
private class CatalogApplication : WebApplicationFactory<Program>
{ {
builder.ConfigureAppConfiguration(c =>
public TestServer CreateServer()
{
Services
.MigrateDbContext<CatalogContext>((context, services) =>
{
var env = services.GetService<IWebHostEnvironment>();
var settings = services.GetService<IOptions<CatalogSettings>>();
var logger = services.GetService<ILogger<CatalogContextSeed>>();
new CatalogContextSeed()
.SeedAsync(context, env, settings, logger)
.Wait();
})
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
return Server;
}
protected override IHost CreateHost(IHostBuilder builder)
{ {
var directory = Path.GetDirectoryName(typeof(CatalogScenariosBase).Assembly.Location)!;
builder.ConfigureAppConfiguration(c =>
{
var directory = Path.GetDirectoryName(typeof(CatalogScenariosBase).Assembly.Location)!;
c.AddJsonFile(Path.Combine(directory, "appsettings.json"), optional: false);
});
c.AddJsonFile(Path.Combine(directory, "appsettings.json"), optional: false);
});
return base.CreateHost(builder);
return base.CreateHost(builder);
}
} }
public static class Get public static class Get


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs View File

@ -23,7 +23,7 @@ public class GracePeriodConfirmedIntegrationEventHandler : IIntegrationEventHand
/// <returns></returns> /// <returns></returns>
public async Task Handle(GracePeriodConfirmedIntegrationEvent @event) public async Task Handle(GracePeriodConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderPaymentFailedIntegrationEventHandler :
public async Task Handle(OrderPaymentFailedIntegrationEvent @event) public async Task Handle(OrderPaymentFailedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderPaymentSucceededIntegrationEventHandler :
public async Task Handle(OrderPaymentSucceededIntegrationEvent @event) public async Task Handle(OrderPaymentSucceededIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderStockConfirmedIntegrationEventHandler :
public async Task Handle(OrderStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs View File

@ -14,7 +14,7 @@ public class OrderStockRejectedIntegrationEventHandler : IIntegrationEventHandle
public async Task Handle(OrderStockRejectedIntegrationEvent @event) public async Task Handle(OrderStockRejectedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs View File

@ -24,7 +24,7 @@ public class UserCheckoutAcceptedIntegrationEventHandler : IIntegrationEventHand
/// <returns></returns> /// <returns></returns>
public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event) public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIn
public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event) public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderStatusChangedToCancelledIntegrationEventHandler : IIntegration
public async Task Handle(OrderStatusChangedToCancelledIntegrationEvent @event) public async Task Handle(OrderStatusChangedToCancelledIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEvent
public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event) public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs View File

@ -16,7 +16,7 @@ public class OrderStatusChangedToShippedIntegrationEventHandler : IIntegrationEv
public async Task Handle(OrderStatusChangedToShippedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToShippedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs View File

@ -17,7 +17,7 @@ public class OrderStatusChangedToStockConfirmedIntegrationEventHandler :
public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs View File

@ -17,7 +17,7 @@ public class OrderStatusChangedToSubmittedIntegrationEventHandler :
public async Task Handle(OrderStatusChangedToSubmittedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToSubmittedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


+ 1
- 1
src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs View File

@ -21,7 +21,7 @@ public class OrderStatusChangedToStockConfirmedIntegrationEventHandler :
public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event) public async Task Handle(OrderStatusChangedToStockConfirmedIntegrationEvent @event)
{ {
using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}"))
using (LogContext.PushProperty("IntegrationEventContext", @event.Id))
{ {
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event);


Loading…
Cancel
Save