[FA-misc] Initial MassTransit implementation seems to work
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
using FictionArchive.Common.Extensions;
|
||||
using FictionArchive.Service.NovelService.Consumers;
|
||||
using FictionArchive.Service.NovelService.GraphQL;
|
||||
using FictionArchive.Service.NovelService.Models.Configuration;
|
||||
using FictionArchive.Service.NovelService.Models.IntegrationEvents;
|
||||
using FictionArchive.Service.NovelService.Services;
|
||||
using FictionArchive.Service.NovelService.Services.EventHandlers;
|
||||
using FictionArchive.Service.NovelService.Services.SourceAdapters;
|
||||
using FictionArchive.Service.NovelService.Services.SourceAdapters.Novelpia;
|
||||
using FictionArchive.Service.Shared;
|
||||
using FictionArchive.Service.Shared.Extensions;
|
||||
using FictionArchive.Service.Shared.Services.EventBus.Implementations;
|
||||
using FictionArchive.Service.Shared.Services.GraphQL;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -25,18 +23,19 @@ public class Program
|
||||
|
||||
builder.Services.AddMemoryCache();
|
||||
|
||||
#region Event Bus
|
||||
#region MassTransit
|
||||
|
||||
if (!isSchemaExport)
|
||||
{
|
||||
builder.Services.AddRabbitMQ(opt =>
|
||||
{
|
||||
builder.Configuration.GetSection("RabbitMQ").Bind(opt);
|
||||
})
|
||||
.Subscribe<TranslationRequestCompletedEvent, TranslationRequestCompletedEventHandler>()
|
||||
.Subscribe<NovelUpdateRequestedEvent, NovelUpdateRequestedEventHandler>()
|
||||
.Subscribe<ChapterPullRequestedEvent, ChapterPullRequestedEventHandler>()
|
||||
.Subscribe<FileUploadRequestStatusUpdateEvent, FileUploadRequestStatusUpdateEventHandler>();
|
||||
builder.Services.AddFictionArchiveMassTransit(
|
||||
builder.Configuration,
|
||||
x =>
|
||||
{
|
||||
x.AddConsumer<TranslationRequestCompletedConsumer>();
|
||||
x.AddConsumer<FileUploadRequestStatusUpdateConsumer>();
|
||||
x.AddConsumer<NovelUpdateRequestedConsumer>();
|
||||
x.AddConsumer<ChapterPullRequestedConsumer>();
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user