namespace fix
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace AipsCore.Application.Abstract;
|
||||
namespace AipsCore.Application.Abstract.MessageBroking;
|
||||
|
||||
public interface IMessagePublisher
|
||||
{
|
||||
@@ -1,5 +1,7 @@
|
||||
using AipsCore.Application.Abstract;
|
||||
using AipsCore.Application.Abstract.MessageBroking;
|
||||
using AipsCore.Application.Common.Dispatcher;
|
||||
using AipsCore.Infrastructure.MessageBroking.RabbitMQ;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -15,6 +17,9 @@ public static class AipsRegistrationExtensions
|
||||
services.AddPersistence(configuration);
|
||||
|
||||
services.AddUserContext(configuration);
|
||||
|
||||
services.AddSingleton<IRabbitMqConnection, RabbitMqConnection>();
|
||||
services.AddSingleton<IMessagePublisher, RabbitMqPublisher>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,11 @@ public class RabbitMqConnection : IRabbitMqConnection
|
||||
{
|
||||
if (_connection is null)
|
||||
{
|
||||
throw new InvalidOperationException($"RabbitMQ connection not created for {_configuration.GetEnvRabbitMqAmqpUri()}");
|
||||
await CreateConnectionAsync();
|
||||
//throw new InvalidOperationException($"RabbitMQ connection not created for {_configuration.GetEnvRabbitMqAmqpUri()}");
|
||||
}
|
||||
|
||||
return await _connection.CreateChannelAsync(null, cancellationToken);
|
||||
return await _connection!.CreateChannelAsync(null, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task CreateConnectionAsync()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using AipsCore.Application.Abstract;
|
||||
using AipsCore.Application.Abstract.MessageBroking;
|
||||
using RabbitMQ.Client;
|
||||
|
||||
namespace AipsCore.Infrastructure.MessageBroking.RabbitMQ;
|
||||
|
||||
Reference in New Issue
Block a user