feat: Add RabbitMQ
This commit is contained in:
parent
d3034c1a06
commit
8902080336
15 changed files with 2292 additions and 2069 deletions
|
|
@ -2,6 +2,7 @@ using BMA.EHR.Application;
|
|||
using BMA.EHR.Application.Repositories.Reports;
|
||||
using BMA.EHR.Domain.Middlewares;
|
||||
using BMA.EHR.Infrastructure;
|
||||
using BMA.EHR.Infrastructure.MessageQueue;
|
||||
using BMA.EHR.Infrastructure.Persistence;
|
||||
using BMA.EHR.Insignia.Service;
|
||||
using BMA.EHR.Insignia.Service.Controllers;
|
||||
|
|
@ -90,6 +91,9 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
builder.Services.AddLeaveApplication();
|
||||
builder.Services.AddLeavePersistence(builder.Configuration);
|
||||
|
||||
// RabbitMQ
|
||||
builder.Services.AddMessageQueue();
|
||||
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
options.SuppressAsyncSuffixInActionNames = false;
|
||||
|
|
@ -172,6 +176,9 @@ var app = builder.Build();
|
|||
await using var db = scope.ServiceProvider.GetRequiredService<ApplicationDBContext>();
|
||||
await db.Database.MigrateAsync();
|
||||
|
||||
var rabbitMQConsumer = app.Services.GetRequiredService<RabbitMQConsumer>();
|
||||
rabbitMQConsumer.StartReceiving();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue