Browse Source

Fix non-structured traces

pull/970/head
Savorboard 6 years ago
parent
commit
2f68e5787c
3 changed files with 11 additions and 14 deletions
  1. +8
    -8
      src/Services/Basket/Basket.API/Startup.cs
  2. +3
    -5
      src/Services/Catalog/Catalog.API/Startup.cs
  3. +0
    -1
      src/Services/Location/Locations.API/Startup.cs

+ 8
- 8
src/Services/Basket/Basket.API/Startup.cs View File

@ -75,6 +75,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
return ConnectionMultiplexer.Connect(configuration);
});
services.AddIntegrationEventHandler();
services.AddCap(options =>
{
options.UseInMemoryStorage();
@ -108,9 +109,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
options.DefaultGroup = Configuration["SubscriptionClientName"];
}
});
RegisterEventBus(services);
services.AddSwaggerGen(options =>
{
options.DescribeAllEnumsAsStrings();
@ -245,16 +244,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
app.UseAuthentication();
}
}
private void RegisterEventBus(IServiceCollection services)
public static class CustomExtensionMethods
{
public static IServiceCollection AddIntegrationEventHandler(this IServiceCollection services)
{
services.AddTransient<ProductPriceChangedIntegrationEventHandler>();
services.AddTransient<OrderStartedIntegrationEventHandler>();
}
}
return services;
}
public static class CustomExtensionMethods
{
public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration)
{
var hcBuilder = services.AddHealthChecks();


+ 3
- 5
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -37,7 +37,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
.AddCustomMVC(Configuration)
.AddCustomDbContext(Configuration)
.AddCustomOptions(Configuration)
.AddIntegrationServices()
.AddIntegrationEventHandler()
.AddEventBus(Configuration)
.AddSwagger()
.AddCustomHealthCheck(Configuration);
@ -237,14 +237,12 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
}
public static IServiceCollection AddIntegrationServices(this IServiceCollection services)
public static IServiceCollection AddIntegrationEventHandler(this IServiceCollection services)
{
//Handlers
services.AddTransient<OrderStatusChangedToAwaitingValidationIntegrationEventHandler>(); // OrderStatusChangedToAwaitingValidationIntegrationEvent
services.AddTransient<OrderStatusChangedToPaidIntegrationEventHandler>(); // OrderStatusChangedToPaidIntegrationEvent
return services;
}
}
public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration)
{


+ 0
- 1
src/Services/Location/Locations.API/Startup.cs View File

@ -18,7 +18,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using RabbitMQ.Client;
using Swashbuckle.AspNetCore.Swagger;
using System;
using System.Collections.Generic;


Loading…
Cancel
Save