Fix non-structured traces
This commit is contained in:
parent
dd7c7d78e1
commit
2f68e5787c
@ -75,6 +75,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
return ConnectionMultiplexer.Connect(configuration);
|
||||
});
|
||||
|
||||
services.AddIntegrationEventHandler();
|
||||
services.AddCap(options =>
|
||||
{
|
||||
options.UseInMemoryStorage();
|
||||
@ -109,8 +110,6 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
}
|
||||
});
|
||||
|
||||
RegisterEventBus(services);
|
||||
|
||||
services.AddSwaggerGen(options =>
|
||||
{
|
||||
options.DescribeAllEnumsAsStrings();
|
||||
@ -245,16 +244,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
||||
|
||||
app.UseAuthentication();
|
||||
}
|
||||
|
||||
private void RegisterEventBus(IServiceCollection services)
|
||||
{
|
||||
services.AddTransient<ProductPriceChangedIntegrationEventHandler>();
|
||||
services.AddTransient<OrderStartedIntegrationEventHandler>();
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomExtensionMethods
|
||||
{
|
||||
public static IServiceCollection AddIntegrationEventHandler(this IServiceCollection services)
|
||||
{
|
||||
services.AddTransient<ProductPriceChangedIntegrationEventHandler>();
|
||||
services.AddTransient<OrderStartedIntegrationEventHandler>();
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var hcBuilder = services.AddHealthChecks();
|
||||
|
@ -37,7 +37,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
|
||||
.AddCustomMVC(Configuration)
|
||||
.AddCustomDbContext(Configuration)
|
||||
.AddCustomOptions(Configuration)
|
||||
.AddIntegrationServices()
|
||||
.AddIntegrationEventHandler()
|
||||
.AddEventBus(Configuration)
|
||||
.AddSwagger()
|
||||
.AddCustomHealthCheck(Configuration);
|
||||
@ -237,12 +237,10 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user