Ir al contenido

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.

Configuración e Integraciones — EricksonLopez.Events

using System.Text.Json;
using EricksonLopez.Events.Bus.Configuration;
using EricksonLopez.Events.Bus.Extensions;
using EricksonLopez.Events.Serialization.SystemTextJson;
using Microsoft.Extensions.DependencyInjection;
namespace Example.EventsConfig;
public static class EventsConfiguration
{
public static void Configure(IServiceCollection services, JsonSerializerOptions jsonOptions)
{
services.AddEventBus(options =>
{
options.ExecutionMode = EventExecutionMode.Sequential;
options.ErrorPolicy = ErrorHandlingPolicy.FailFast;
options.ScopePolicy = HandlerScopePolicy.Auto;
options.MaxReentrancyDepth = 10;
});
services.AddGeneratedEventHandlers();
jsonOptions.AddEventsConverters();
}
}
  • CloudEvents (EricksonLopez.Events.CloudEvents): .ToCloudEvent(), .ToEventEnvelope() y jsonOptions.ConfigureForCloudEvents().
  • OpenTelemetry (EricksonLopez.Events.OpenTelemetry): tracerBuilder.AddEventsInstrumentation() y meterBuilder.AddEventsInstrumentation().