fixed namespace

master
Young 7 months ago
parent 4f6aaa638f
commit a914ce8153

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus; namespace Infrastructure.EventBus;
public interface IEventBus public interface IEventBus
{ {

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus; namespace Infrastructure.EventBus;
public interface IIntegrationEventHandler<in TIntegrationEvent> public interface IIntegrationEventHandler<in TIntegrationEvent>
where TIntegrationEvent : IntegrationEvent where TIntegrationEvent : IntegrationEvent

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Roller.Infrastructure.EventBus; namespace Infrastructure.EventBus;
[method: JsonConstructor] [method: JsonConstructor]
public class IntegrationEvent(Guid id, DateTime createdDate) public class IntegrationEvent(Guid id, DateTime createdDate)

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus.RabbitMQ; namespace Infrastructure.EventBus.RabbitMQ;
public interface IPersistentConnection public interface IPersistentConnection
{ {

@ -1,12 +1,12 @@
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
using System.Text.Json; using System.Text.Json;
using Infrastructure.EventBus.Subscriptions;
using Polly; using Polly;
using RabbitMQ.Client.Events; using RabbitMQ.Client.Events;
using RabbitMQ.Client.Exceptions; using RabbitMQ.Client.Exceptions;
using Roller.Infrastructure.EventBus.Subscriptions;
namespace Roller.Infrastructure.EventBus.RabbitMQ; namespace Infrastructure.EventBus.RabbitMQ;
public class RabbitMQEventBus : IEventBus public class RabbitMQEventBus : IEventBus
{ {
@ -255,8 +255,8 @@ public class RabbitMQEventBus : IEventBus
var @event = JsonSerializer.Deserialize(message, eventType); var @event = JsonSerializer.Deserialize(message, eventType);
var eventHandlerType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType); var eventHandlerType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType);
await Task.Yield(); await Task.Yield();
await (Task)eventHandlerType.GetMethod(nameof(IIntegrationEventHandler<IntegrationEvent>.HandleAsync)) await ((Task)eventHandlerType.GetMethod(nameof(IIntegrationEventHandler<IntegrationEvent>.HandleAsync))
.Invoke(handler, [@event]); .Invoke(handler, [@event]))!;
} }
_logger.LogTrace("Processed event {EventName}.", eventName); _logger.LogTrace("Processed event {EventName}.", eventName);

@ -4,7 +4,7 @@ using Polly;
using RabbitMQ.Client.Events; using RabbitMQ.Client.Events;
using RabbitMQ.Client.Exceptions; using RabbitMQ.Client.Exceptions;
namespace Roller.Infrastructure.EventBus.RabbitMQ; namespace Infrastructure.EventBus.RabbitMQ;
public class RabbitMQPersistentConnection( public class RabbitMQPersistentConnection(
IConnectionFactory connectionFactory, IConnectionFactory connectionFactory,

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus.RabbitMQ; namespace Infrastructure.EventBus.RabbitMQ;
public class RabbitMqConnectionOptions public class RabbitMqConnectionOptions
{ {

@ -1,9 +1,9 @@
using Microsoft.Extensions.Configuration; using Infrastructure.EventBus.RabbitMQ;
using Infrastructure.EventBus.Subscriptions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Roller.Infrastructure.EventBus.RabbitMQ;
using Roller.Infrastructure.EventBus.Subscriptions;
namespace Roller.Infrastructure.EventBus; namespace Infrastructure.EventBus;
public static class ServiceCollectionExtensions public static class ServiceCollectionExtensions
{ {

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus.Subscriptions; namespace Infrastructure.EventBus.Subscriptions;
public interface IEventBusSubscriptionManager public interface IEventBusSubscriptionManager
{ {

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus.Subscriptions; namespace Infrastructure.EventBus.Subscriptions;
public class InMemoryEventBusSubscriptionManager : IEventBusSubscriptionManager public class InMemoryEventBusSubscriptionManager : IEventBusSubscriptionManager
{ {

@ -1,4 +1,4 @@
namespace Roller.Infrastructure.EventBus.Subscriptions; namespace Infrastructure.EventBus.Subscriptions;
public class Subscription public class Subscription
{ {

Loading…
Cancel
Save