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);
|
return ConnectionMultiplexer.Connect(configuration);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
services.AddIntegrationEventHandler();
|
||||||
services.AddCap(options =>
|
services.AddCap(options =>
|
||||||
{
|
{
|
||||||
options.UseInMemoryStorage();
|
options.UseInMemoryStorage();
|
||||||
@ -108,9 +109,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
|||||||
options.DefaultGroup = Configuration["SubscriptionClientName"];
|
options.DefaultGroup = Configuration["SubscriptionClientName"];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterEventBus(services);
|
|
||||||
|
|
||||||
services.AddSwaggerGen(options =>
|
services.AddSwaggerGen(options =>
|
||||||
{
|
{
|
||||||
options.DescribeAllEnumsAsStrings();
|
options.DescribeAllEnumsAsStrings();
|
||||||
@ -245,16 +244,17 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
|
|||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterEventBus(IServiceCollection services)
|
|
||||||
{
|
|
||||||
services.AddTransient<ProductPriceChangedIntegrationEventHandler>();
|
|
||||||
services.AddTransient<OrderStartedIntegrationEventHandler>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CustomExtensionMethods
|
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)
|
public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var hcBuilder = services.AddHealthChecks();
|
var hcBuilder = services.AddHealthChecks();
|
||||||
|
@ -37,7 +37,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
|
|||||||
.AddCustomMVC(Configuration)
|
.AddCustomMVC(Configuration)
|
||||||
.AddCustomDbContext(Configuration)
|
.AddCustomDbContext(Configuration)
|
||||||
.AddCustomOptions(Configuration)
|
.AddCustomOptions(Configuration)
|
||||||
.AddIntegrationServices()
|
.AddIntegrationEventHandler()
|
||||||
.AddEventBus(Configuration)
|
.AddEventBus(Configuration)
|
||||||
.AddSwagger()
|
.AddSwagger()
|
||||||
.AddCustomHealthCheck(Configuration);
|
.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<OrderStatusChangedToAwaitingValidationIntegrationEventHandler>(); // OrderStatusChangedToAwaitingValidationIntegrationEvent
|
||||||
services.AddTransient<OrderStatusChangedToPaidIntegrationEventHandler>(); // OrderStatusChangedToPaidIntegrationEvent
|
services.AddTransient<OrderStatusChangedToPaidIntegrationEventHandler>(); // OrderStatusChangedToPaidIntegrationEvent
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddEventBus(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,6 @@ using Microsoft.Extensions.Configuration;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using RabbitMQ.Client;
|
|
||||||
using Swashbuckle.AspNetCore.Swagger;
|
using Swashbuckle.AspNetCore.Swagger;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user