public static IEventServerBuilder AddCoreServices(this IEventServerBuilder builder) { builder.Services.AddSingleton <TriggerService>(); builder.Services.AddHostedService <HostedProcessingService>(); builder.Services.AddHostedService <HostedDeliveryService>(); return(builder); }
public static IEventServerBuilder AddInMemoryStores(this IEventServerBuilder builder) { builder.Services.AddSingleton <IEventQueueStore, InMemoryEventQueueStore>(); builder.Services.AddSingleton <IMetadataStore, InMemoryMetadataStore>(); builder.Services.AddSingleton <IObjectStore, InMemoryObjectStore>(); builder.Services.AddSingleton <ISubscriberQueueStore, InMemorySubscriberQueueStore>(); builder.Services.AddSingleton <ISubscriberStore, InMemorySubscriberStore>(); return(builder); }
public static IEventServerBuilder AddDefaultServices(this IEventServerBuilder builder) { builder.Services.TryAddTransient <IRegistrationService, DefaultRegistrationService>(); builder.Services.TryAddTransient <IInjestionService, DefaultInjestionService>(); builder.Services.TryAddTransient <IMetadataService, DefaultMetadataService>(); builder.Services.TryAddTransient <IEventProcessingService, DefaultEventProcessingService>(); builder.Services.TryAddTransient <IObjectUpdateService, DefaultObjectUpdateService>(); return(builder); }
public static IEventServerBuilder AddSqlServerStores(this IEventServerBuilder builder, Action <DbContextOptionsBuilder> configureDb) { builder.Services.AddAutoMapper(config => { config.AddProfile <MappingProfile>(); }); builder.Services.AddDbContextPool <EventServerContext>(configureDb); builder.Services.AddScoped <IEventQueueStore, SqlEventQueueStore>(); builder.Services.AddScoped <IMetadataStore, SqlMetadataStore>(); builder.Services.AddScoped <IObjectStore, SqlObjectStore>(); builder.Services.AddScoped <ISubscriberQueueStore, SqlSubscriberQueueStore>(); builder.Services.AddScoped <ISubscriberStore, SqlSubscriberStore>(); return(builder); }
public static IEventServerBuilder AddRedisStores(this IEventServerBuilder builder, Action <RedisStoreOptions> configure) { builder.Services.AddAutoMapper(config => { config.AddProfile <MappingProfile>(); }); builder.Services.AddOptions(); builder.Services.Configure <RedisStoreOptions>(configure); builder.Services.AddSingleton <IRedisClientsManager>(provider => { var opts = provider.GetRequiredService <IOptions <RedisStoreOptions> >(); return(new RedisManagerPool(opts.Value.ConnectionString)); }); builder.Services.AddScoped <IEventQueueStore, RedisEventQueueStore>(); builder.Services.AddScoped <IMetadataStore, RedisMetadataStore>(); builder.Services.AddScoped <IObjectStore, RedisObjectStore>(); //builder.Services.AddScoped<ISubscriberQueueStore, SqlSubscriberQueueStore>(); //builder.Services.AddScoped<ISubscriberStore, SqlSubscriberStore>(); return(builder); }
public static IEventServerBuilder AddHttpPostDeliveryWithRetry(this IEventServerBuilder builder, int retryCount = 6) { builder.Services.AddHttpClient <IDeliveryService, DefaultDeliveryService>() .AddPolicyHandler(GetRetryPolicy(retryCount)); return(builder); }
public static IEventServerBuilder AddHttpPostDelivery(this IEventServerBuilder builder) { builder.Services.AddHttpClient <IDeliveryService, DefaultDeliveryService>(); return(builder); }