diff --git a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs index 14f0345..1b135da 100644 --- a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs +++ b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs @@ -7,6 +7,7 @@ using Fake.RabbitMQ; using FreeRedis; using InterfaceForward.Application.Contracts; using InterfaceForward.Application.Helpers; +using InterfaceForward.Application.HostServices; using InterfaceForward.Domain.Shared; using InterfaceForward.Repositories; using Microsoft.Extensions.Configuration; @@ -32,6 +33,8 @@ public class InterfaceForwardApplicationModule:FakeModule }); context.Services.Configure(configuration.GetSection("InterfaceRelay")); + + context.Services.AddHostedService(); var options = configuration.GetSection("Redis").Get(); if (options == null) diff --git a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs index 18feae4..1116208 100644 --- a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs +++ b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs @@ -10,6 +10,7 @@ using RabbitMQ.Client.Events; namespace InterfaceForward.Application.Rabbit; +[ExposeServices(typeof(IRabbitHandler))] public class BatchForwardEventHandler( InterfaceForwardCommon forwardCommon, RabbitClient rabbitClient,