From 122d162bd84d1f46841cfdfdf5529f87568d5095 Mon Sep 17 00:00:00 2001 From: Paolo Possanzini Date: Fri, 15 Nov 2024 10:26:21 +0100 Subject: [PATCH] queue managements --- Arbitrer.GRPC/MessageDispatcher.cs | 6 +- Arbitrer.GRPC/RequestsManager.cs | 2 +- Arbitrer.Kafka/Arbitrer.Kafka.csproj | 4 +- Arbitrer.Kafka/MessageDispatcher.cs | 6 +- Arbitrer.Kafka/RequestsManager.cs | 14 +- Arbitrer.RabbitMQ/Arbitrer.RabbitMQ.csproj | 4 +- Arbitrer.RabbitMQ/Extensions/Extensions.cs | 13 ++ Arbitrer.RabbitMQ/MessageDispatcher.cs | 6 +- Arbitrer.RabbitMQ/MessageDispatcherOptions.cs | 22 +--- Arbitrer.RabbitMQ/RequestsManager.cs | 37 +----- Arbitrer/Arbitrer.cs | 8 +- Arbitrer/Arbitrer.csproj | 6 +- Arbitrer/ArbitrerOptions.cs | 2 +- Arbitrer/extensions/ArbitrerExtensions.cs | 51 ++++---- arbitrer.sln | 23 ---- .../Commands/MediatorNotification1.cs | 7 - tests/cqrs.models/Commands/MediatrRequest1.cs | 7 - tests/cqrs.models/Commands/MediatrRequest2.cs | 8 -- tests/cqrs.models/Commands/MediatrRequest3.cs | 8 -- tests/cqrs.models/Commands/MediatrRequest4.cs | 7 - tests/cqrs.models/Commands/MediatrRequest5.cs | 7 - .../Commands/MediatrRequestWithException.cs | 8 -- .../MediatrRequestWithHandleException.cs | 8 -- .../Commands/MediatrRequestWithNoHandlers.cs | 7 - tests/cqrs.models/Dto/ResponseDTO.cs | 7 - tests/cqrs.models/cqrs.models.csproj | 13 -- tests/receiver/Program.cs | 31 ----- tests/receiver/Properties/launchSettings.json | 11 -- tests/receiver/Worker.cs | 20 --- tests/receiver/appsettings.Development.json | 8 -- tests/receiver/appsettings.json | 18 --- tests/receiver/handlers/CommandHandler.cs | 52 -------- tests/receiver/receiver.csproj | 20 --- tests/sender/Program.cs | 32 ----- tests/sender/Properties/launchSettings.json | 11 -- tests/sender/Worker.cs | 120 ------------------ tests/sender/appsettings.Development.json | 8 -- tests/sender/appsettings.json | 20 --- tests/sender/sender.csproj | 20 --- 39 files changed, 74 insertions(+), 588 deletions(-) delete mode 100644 tests/cqrs.models/Commands/MediatorNotification1.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequest1.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequest2.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequest3.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequest4.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequest5.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequestWithException.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequestWithHandleException.cs delete mode 100644 tests/cqrs.models/Commands/MediatrRequestWithNoHandlers.cs delete mode 100644 tests/cqrs.models/Dto/ResponseDTO.cs delete mode 100644 tests/cqrs.models/cqrs.models.csproj delete mode 100644 tests/receiver/Program.cs delete mode 100644 tests/receiver/Properties/launchSettings.json delete mode 100644 tests/receiver/Worker.cs delete mode 100644 tests/receiver/appsettings.Development.json delete mode 100644 tests/receiver/appsettings.json delete mode 100644 tests/receiver/handlers/CommandHandler.cs delete mode 100644 tests/receiver/receiver.csproj delete mode 100644 tests/sender/Program.cs delete mode 100644 tests/sender/Properties/launchSettings.json delete mode 100644 tests/sender/Worker.cs delete mode 100644 tests/sender/appsettings.Development.json delete mode 100644 tests/sender/appsettings.json delete mode 100644 tests/sender/sender.csproj diff --git a/Arbitrer.GRPC/MessageDispatcher.cs b/Arbitrer.GRPC/MessageDispatcher.cs index 5859ed5..abb95a0 100644 --- a/Arbitrer.GRPC/MessageDispatcher.cs +++ b/Arbitrer.GRPC/MessageDispatcher.cs @@ -93,7 +93,7 @@ public bool CanDispatch() var result = await grpcClient.ManageArbitrerMessageAsync(new RequestMessage { Body = message, - ArbitrerType = queueName ?? typeof(TRequest).TypeQueueName(arbitrerOptions) + ArbitrerType = queueName ?? typeof(TRequest).ArbitrerTypeName(arbitrerOptions) }); return JsonConvert.DeserializeObject>(result.Body, options.SerializerSettings); } @@ -109,7 +109,7 @@ public Task Notify(TRequest request, string queueName = null, Cancella { var message = JsonConvert.SerializeObject(request, options.SerializerSettings); - logger.LogInformation($"Sending notifications of: {typeof(TRequest).Name}/{queueName ?? request.GetType().TypeQueueName(arbitrerOptions)}"); + logger.LogInformation($"Sending notifications of: {typeof(TRequest).Name}/{queueName ?? request.GetType().ArbitrerTypeName(arbitrerOptions)}"); foreach (var channel in DestinationChannels) { @@ -117,7 +117,7 @@ public Task Notify(TRequest request, string queueName = null, Cancella grpcClient.ManageArbitrerNotificationAsync(new NotifyMessage() { Body = message, - ArbitrerType = queueName ?? typeof(TRequest).TypeQueueName(arbitrerOptions) + ArbitrerType = queueName ?? typeof(TRequest).ArbitrerTypeName(arbitrerOptions) }); } diff --git a/Arbitrer.GRPC/RequestsManager.cs b/Arbitrer.GRPC/RequestsManager.cs index bb62ea3..68d615d 100644 --- a/Arbitrer.GRPC/RequestsManager.cs +++ b/Arbitrer.GRPC/RequestsManager.cs @@ -43,7 +43,7 @@ public RequestsManager(IOptions options, ILogger k.TypeQueueName(arbitrerOptions.Value), v => v); + _typeMappings = requestsManagerOptions.Value.AcceptMessageTypes.ToDictionary(k => k.ArbitrerTypeName(arbitrerOptions.Value), v => v); } diff --git a/Arbitrer.Kafka/Arbitrer.Kafka.csproj b/Arbitrer.Kafka/Arbitrer.Kafka.csproj index c294f33..8af62bc 100644 --- a/Arbitrer.Kafka/Arbitrer.Kafka.csproj +++ b/Arbitrer.Kafka/Arbitrer.Kafka.csproj @@ -25,8 +25,8 @@ - - + + diff --git a/Arbitrer.Kafka/MessageDispatcher.cs b/Arbitrer.Kafka/MessageDispatcher.cs index 0c21fde..7c36c3e 100644 --- a/Arbitrer.Kafka/MessageDispatcher.cs +++ b/Arbitrer.Kafka/MessageDispatcher.cs @@ -128,7 +128,7 @@ public bool CanDispatch() _callbackMapper.TryAdd(correlationId, tcs); await _producer.ProduceAsync( - topic: queueName ?? typeof(TRequest).TypeQueueName(_arbitrerOptions), + topic: queueName ?? typeof(TRequest).ArbitrerTypeName(_arbitrerOptions), message: new Message { Value = message }, cancellationToken); cancellationToken.Register(() => _callbackMapper.TryRemove(correlationId, out var tmp)); @@ -149,10 +149,10 @@ public async Task Notify(TRequest request, string queueName = null, Ca { var message = JsonConvert.SerializeObject(request, _options.SerializerSettings); - _logger.LogInformation($"Sending message to: {Consts.ArbitrerExchangeName}/{queueName ?? request.GetType().TypeQueueName(_arbitrerOptions)}"); + _logger.LogInformation($"Sending message to: {Consts.ArbitrerExchangeName}/{queueName ?? request.GetType().ArbitrerTypeName(_arbitrerOptions)}"); await _producer.ProduceAsync( - topic: queueName ?? typeof(TRequest).TypeQueueName(_arbitrerOptions), + topic: queueName ?? typeof(TRequest).ArbitrerTypeName(_arbitrerOptions), message: new Message { Value = message }, cancellationToken); } diff --git a/Arbitrer.Kafka/RequestsManager.cs b/Arbitrer.Kafka/RequestsManager.cs index 7db56e6..dd67acc 100644 --- a/Arbitrer.Kafka/RequestsManager.cs +++ b/Arbitrer.Kafka/RequestsManager.cs @@ -74,24 +74,24 @@ public Task StartAsync(CancellationToken cancellationToken) foreach (var t in _arbitrer.GetLocalRequestsTypes()) { if (t is null) continue; - _provider.CreateTopicAsync(_options, t.TypeQueueName(_arbitrerOptions)); - var isNotification = typeof(INotification).IsAssignableFrom(t); + _provider.CreateTopicAsync(_options, t.ArbitrerTypeName(_arbitrerOptions)); - if (isNotification) + + if (t.IsNotification()) { - notificationsSubscriptions.Add(t.TypeQueueName(_arbitrerOptions)); + notificationsSubscriptions.Add(t.ArbitrerTypeName(_arbitrerOptions)); var consumerMethod = typeof(RequestsManager) .GetMethod("ConsumeChannelNotification", BindingFlags.Instance | BindingFlags.NonPublic)? .MakeGenericMethod(t); - _methods.Add(t.TypeQueueName(_arbitrerOptions), consumerMethod); + _methods.Add(t.ArbitrerTypeName(_arbitrerOptions), consumerMethod); } else { - requestSubscriptions.Add(t.TypeQueueName(_arbitrerOptions)); + requestSubscriptions.Add(t.ArbitrerTypeName(_arbitrerOptions)); var consumerMethod = typeof(RequestsManager) .GetMethod("ConsumeChannelMessage", BindingFlags.Instance | BindingFlags.NonPublic)? .MakeGenericMethod(t); - _methods.Add(t.TypeQueueName(_arbitrerOptions), consumerMethod); + _methods.Add(t.ArbitrerTypeName(_arbitrerOptions), consumerMethod); } } diff --git a/Arbitrer.RabbitMQ/Arbitrer.RabbitMQ.csproj b/Arbitrer.RabbitMQ/Arbitrer.RabbitMQ.csproj index d200f28..1ccded9 100644 --- a/Arbitrer.RabbitMQ/Arbitrer.RabbitMQ.csproj +++ b/Arbitrer.RabbitMQ/Arbitrer.RabbitMQ.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/Arbitrer.RabbitMQ/Extensions/Extensions.cs b/Arbitrer.RabbitMQ/Extensions/Extensions.cs index 5ca5680..4305223 100644 --- a/Arbitrer.RabbitMQ/Extensions/Extensions.cs +++ b/Arbitrer.RabbitMQ/Extensions/Extensions.cs @@ -29,6 +29,19 @@ public static IServiceCollection AddArbitrerRabbitMQMessageDispatcher(this IServ return services; } + public static string ArbitrerQueueName(this Type t, ArbitrerOptions options, StringBuilder sb = null) + { + if (options.QueueNames.TryGetValue(t, out string queueName)) return queueName; + + sb = sb ?? new StringBuilder(); + sb.Append(t.ArbitrerTypeName(options)); + + sb.Append("$"); + if (t.IsNotification()) + sb.Append(Guid.NewGuid().ToString()); + return sb.ToString(); + } + public static MessageDispatcherOptions DispatchOnlyTo(this MessageDispatcherOptions options, Func> assemblySelect) { diff --git a/Arbitrer.RabbitMQ/MessageDispatcher.cs b/Arbitrer.RabbitMQ/MessageDispatcher.cs index b2b9b11..389250b 100644 --- a/Arbitrer.RabbitMQ/MessageDispatcher.cs +++ b/Arbitrer.RabbitMQ/MessageDispatcher.cs @@ -175,7 +175,7 @@ public bool CanDispatch() _sendChannel.BasicPublish( exchange: Constants.ArbitrerExchangeName, - routingKey: queueName ?? typeof(TRequest).TypeQueueName(arbitrerOptions), + routingKey: queueName ?? typeof(TRequest).ArbitrerTypeName(arbitrerOptions), mandatory: true, body: Encoding.UTF8.GetBytes(message), basicProperties: GetBasicProperties(correlationId)); @@ -197,11 +197,11 @@ public Task Notify(TRequest request, string queueName = null, Cancella { var message = JsonConvert.SerializeObject(request, options.SerializerSettings); - logger.LogInformation($"Sending message to: {Constants.ArbitrerExchangeName}/{queueName ?? request.GetType().TypeQueueName(arbitrerOptions)}"); + logger.LogInformation($"Sending message to: {Constants.ArbitrerExchangeName}/{queueName ?? request.GetType().ArbitrerTypeName(arbitrerOptions)}"); _sendChannel.BasicPublish( exchange: Constants.ArbitrerExchangeName, - routingKey: queueName ?? request.GetType().TypeQueueName(arbitrerOptions), + routingKey: queueName ?? request.GetType().ArbitrerTypeName(arbitrerOptions), mandatory: false, body: Encoding.UTF8.GetBytes(message) ); diff --git a/Arbitrer.RabbitMQ/MessageDispatcherOptions.cs b/Arbitrer.RabbitMQ/MessageDispatcherOptions.cs index d9ac1eb..ab60846 100644 --- a/Arbitrer.RabbitMQ/MessageDispatcherOptions.cs +++ b/Arbitrer.RabbitMQ/MessageDispatcherOptions.cs @@ -72,32 +72,12 @@ public class MessageDispatcherOptions public ushort PerConsumerQos { get; set; } = 1; public string ClientName { get; set; } - /// - /// Gets or sets the time-to-live value for deduplication. - /// - /// - /// The DeDuplicationTTL property determines the amount of time, in milliseconds, that an item can be considered duplicate - /// before it is removed from the deduplication cache. The default value is 5000 milliseconds (5 seconds). - /// - /// - /// The time-to-live value for deduplication. - /// - public int DeDuplicationTTL { get; set; } = 5000; - - /// - /// Gets or sets a value indicating whether duplicate entries are enabled for deduplication. - /// - /// - /// true if deduplication is enabled; otherwise, false. - /// - public bool DeDuplicationEnabled { get; set; } = false; /// /// Gets or sets the serializer settings for JSON serialization and deserialization. /// public JsonSerializerSettings SerializerSettings { get; set; } - - public bool UseRoundRobinNotificationDistribution { get; set; } = false; + public HashSet DispatchOnly { get; private set; } = new HashSet(); public HashSet DontDispatch { get; private set; } = new HashSet(); diff --git a/Arbitrer.RabbitMQ/RequestsManager.cs b/Arbitrer.RabbitMQ/RequestsManager.cs index 524a3b8..63bbeff 100644 --- a/Arbitrer.RabbitMQ/RequestsManager.cs +++ b/Arbitrer.RabbitMQ/RequestsManager.cs @@ -50,10 +50,6 @@ public class RequestsManager : IHostedService /// private IModel _channel = null; - /// - /// A HashSet used for deduplication cache. - /// - private readonly HashSet _deduplicationcache = new HashSet(); /// /// Represents a SHA256 hash algorithm instance used for hashing data. @@ -114,10 +110,8 @@ public Task StartAsync(CancellationToken cancellationToken) foreach (var t in _arbitrer.GetLocalRequestsTypes()) { if (t is null) continue; - var isNotification = typeof(INotification).IsAssignableFrom(t) && !typeof(IBaseRequest).IsAssignableFrom(t); - var isExclusive = isNotification && !_options.UseRoundRobinNotificationDistribution; - var queueName = $"{t.TypeQueueName(_arbitrerOptions)}$" + - $"{(isNotification ? (_options.UseRoundRobinNotificationDistribution ? Assembly.GetEntryAssembly()?.FullName : Guid.NewGuid().ToString()) : "")}"; + var isNotification = t.IsNotification(); + var queueName = t.ArbitrerQueueName(_arbitrerOptions); var arguments = new Dictionary(); var timeout = t.QueueTimeout(); @@ -128,9 +122,8 @@ public Task StartAsync(CancellationToken cancellationToken) _channel.QueueDeclare(queue: queueName, durable: _options.Durable, - exclusive: isExclusive, autoDelete: _options.AutoDelete, arguments: arguments); - _channel.QueueBind(queueName, Constants.ArbitrerExchangeName, t.TypeQueueName(_arbitrerOptions)); + _channel.QueueBind(queueName, Constants.ArbitrerExchangeName, t.ArbitrerTypeName(_arbitrerOptions)); var consumer = new AsyncEventingBasicConsumer(_channel); @@ -203,30 +196,6 @@ private async Task ConsumeChannelNotification(object sender, BasicDeliverEven { var msg = ea.Body.ToArray(); - if (_options.DeDuplicationEnabled) - { - var hash = msg.GetHash(_hasher); - lock (_deduplicationcache) - if (_deduplicationcache.Contains(hash)) - { - _logger.LogDebug($"duplicated message received : {ea.Exchange}/{ea.RoutingKey}"); - return; - } - - lock (_deduplicationcache) - _deduplicationcache.Add(hash); - - // Do not await this task -#pragma warning disable CS4014 - Task.Run(async () => - { - await Task.Delay(_options.DeDuplicationTTL); - lock (_deduplicationcache) - _deduplicationcache.Remove(hash); - }); -#pragma warning restore CS4014 - } - _logger.LogDebug("Elaborating notification : {0}", Encoding.UTF8.GetString(msg)); var message = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(msg), _options.SerializerSettings); diff --git a/Arbitrer/Arbitrer.cs b/Arbitrer/Arbitrer.cs index 42732d5..23391df 100644 --- a/Arbitrer/Arbitrer.cs +++ b/Arbitrer/Arbitrer.cs @@ -99,7 +99,7 @@ public HandlerLocation GetLocation(Type t) /// The response object. public async Task InvokeRemoteHandler(TRequest request, string queueName = null) { - _logger.LogDebug($"Invoking remote handler for: {queueName ?? typeof(TRequest).TypeQueueName(_options)}"); + _logger.LogDebug($"Invoking remote handler for: {queueName ?? typeof(TRequest).ArbitrerTypeName(_options)}"); ResponseMessage result = null; foreach (var dispatcher in this._messageDispatchers) @@ -109,7 +109,7 @@ public async Task InvokeRemoteHandler(TRequest r break; } - _logger.LogDebug($"Remote request for {queueName ?? typeof(TRequest).TypeQueueName(_options)} completed!"); + _logger.LogDebug($"Remote request for {queueName ?? typeof(TRequest).ArbitrerTypeName(_options)} completed!"); if (result == null) { @@ -132,10 +132,10 @@ public async Task InvokeRemoteHandler(TRequest r /// A task representing the asynchronous operation. public Task SendRemoteNotification(TRequest request, string queueName = null) where TRequest : INotification { - _logger.LogDebug($"Invoking remote handler for: {queueName ?? typeof(TRequest).TypeQueueName(_options)}"); + _logger.LogDebug($"Invoking remote handler for: {queueName ?? typeof(TRequest).ArbitrerTypeName(_options)}"); Task.WaitAll(_messageDispatchers.Select(i => i.Notify(request, queueName)).ToArray()); - _logger.LogDebug($"Remote request for {queueName ?? typeof(TRequest).TypeQueueName(_options)} completed!"); + _logger.LogDebug($"Remote request for {queueName ?? typeof(TRequest).ArbitrerTypeName(_options)} completed!"); return Task.CompletedTask; } diff --git a/Arbitrer/Arbitrer.csproj b/Arbitrer/Arbitrer.csproj index b080a35..d450a6e 100644 --- a/Arbitrer/Arbitrer.csproj +++ b/Arbitrer/Arbitrer.csproj @@ -29,9 +29,9 @@ - - - + + + \ No newline at end of file diff --git a/Arbitrer/ArbitrerOptions.cs b/Arbitrer/ArbitrerOptions.cs index 7cc6c85..6692c4c 100644 --- a/Arbitrer/ArbitrerOptions.cs +++ b/Arbitrer/ArbitrerOptions.cs @@ -31,7 +31,7 @@ public class ArbitrerOptions /// /// Get the prefix of remote queue /// - public Dictionary QueuePrefixes { get; private set; } = new Dictionary(); + public Dictionary TypePrefixes { get; private set; } = new Dictionary(); public Dictionary QueueNames { get; private set; } = new Dictionary(); } diff --git a/Arbitrer/extensions/ArbitrerExtensions.cs b/Arbitrer/extensions/ArbitrerExtensions.cs index f1cdf2a..7f54529 100644 --- a/Arbitrer/extensions/ArbitrerExtensions.cs +++ b/Arbitrer/extensions/ArbitrerExtensions.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Microsoft.Extensions.Primitives; // ReSharper disable AssignNullToNotNullAttribute @@ -115,9 +116,9 @@ public static ArbitrerOptions SetAsLocalRequest(this ArbitrerOptions options, { options.LocalRequests.Add(typeof(T)); - if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.QueuePrefixes.ContainsKey(typeof(T).FullName)) + if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.TypePrefixes.ContainsKey(typeof(T).FullName)) { - options.QueuePrefixes.Add(typeof(T).FullName, queuePrefix); + options.TypePrefixes.Add(typeof(T).FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${typeof(T).FullName}"); } @@ -135,9 +136,9 @@ public static ArbitrerOptions ListenForNotification(this ArbitrerOptions opti { options.LocalRequests.Add(typeof(T)); - if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.QueuePrefixes.ContainsKey(typeof(T).FullName)) + if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.TypePrefixes.ContainsKey(typeof(T).FullName)) { - options.QueuePrefixes.Add(typeof(T).FullName, queuePrefix); + options.TypePrefixes.Add(typeof(T).FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${typeof(T).FullName}"); } @@ -157,9 +158,9 @@ public static ArbitrerOptions SetAsRemoteRequest(this ArbitrerOptions options { options.RemoteRequests.Add(typeof(T)); - if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.QueuePrefixes.ContainsKey(typeof(T).FullName)) + if (!string.IsNullOrWhiteSpace(queuePrefix) && !options.TypePrefixes.ContainsKey(typeof(T).FullName)) { - options.QueuePrefixes.Add(typeof(T).FullName, queuePrefix); + options.TypePrefixes.Add(typeof(T).FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${typeof(T).FullName}"); } @@ -188,9 +189,9 @@ where typeof(IBaseRequest).IsAssignableFrom(t) || typeof(INotification).IsAssign if (!string.IsNullOrWhiteSpace(queuePrefix)) foreach (var t in types) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${t.FullName}"); } @@ -213,9 +214,9 @@ public static ArbitrerOptions SetAsLocalRequests(this ArbitrerOptions options, F if (!string.IsNullOrWhiteSpace(queuePrefix)) foreach (var t in typesSelect()) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${t.FullName}"); } @@ -242,9 +243,9 @@ where typeof(IBaseRequest).IsAssignableFrom(t) || typeof(INotification).IsAssign if (!string.IsNullOrWhiteSpace(queuePrefix)) foreach (var t in types) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${t.FullName}"); } @@ -271,9 +272,9 @@ public static ArbitrerOptions SetAsRemoteRequests(this ArbitrerOptions options, if (!string.IsNullOrWhiteSpace(queuePrefix)) foreach (var t in types) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to request ${t.FullName}"); } @@ -297,15 +298,20 @@ public static ArbitrerOptions SetNotificationPrefix(this ArbitrerOptions options if (!string.IsNullOrWhiteSpace(queuePrefix)) foreach (var t in types) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to notification ${t.FullName}"); } return options; } + public static bool IsNotification(this Type t) + { + return typeof(INotification).IsAssignableFrom(t) && !typeof(IBaseRequest).IsAssignableFrom(t); + } + public static ArbitrerOptions SetTypeQueueName(this ArbitrerOptions options, string queueName) where T : IBaseRequest { if (options.QueueNames.ContainsKey(typeof(T))) @@ -340,32 +346,31 @@ where typeof(INotification).IsAssignableFrom(t) logger?.LogWarning("SetNotificationPrefix : No Notification classes found in assemblies"); foreach (var t in types) - if (!options.QueuePrefixes.ContainsKey(t.FullName)) + if (!options.TypePrefixes.ContainsKey(t.FullName)) { - options.QueuePrefixes.Add(t.FullName, queuePrefix); + options.TypePrefixes.Add(t.FullName, queuePrefix); logger?.LogInformation($"Added prefix to notification ${t.FullName}"); } return options; } + /// /// Gets the queue name for the specified type. /// /// The type. /// The instance to append the queue name to (optional). /// The queue name for the specified type. - public static string TypeQueueName(this Type t, ArbitrerOptions options, StringBuilder sb = null) + public static string ArbitrerTypeName(this Type t, ArbitrerOptions options, StringBuilder sb = null) { - if (options.QueueNames.TryGetValue(t, out string queueName)) return queueName; - if (t.CustomAttributes.Any()) { var attr = t.GetCustomAttribute(); if (attr != null) return $"{t.Namespace}.{attr.Name}".Replace(".", "_"); } - options.QueuePrefixes.TryGetValue(t.FullName, out var prefix); + options.TypePrefixes.TryGetValue(t.FullName, out var prefix); prefix = prefix ?? options.DefaultQueuePrefix; sb = sb ?? new StringBuilder(); @@ -378,7 +383,7 @@ public static string TypeQueueName(this Type t, ArbitrerOptions options, StringB sb.Append("["); foreach (var ta in t.GenericTypeArguments) { - ta.TypeQueueName(options, sb); + ta.ArbitrerTypeName(options, sb); sb.Append(","); } diff --git a/arbitrer.sln b/arbitrer.sln index 69fd558..dc21fce 100644 --- a/arbitrer.sln +++ b/arbitrer.sln @@ -7,14 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arbitrer", "Arbitrer\Arbitr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arbitrer.RabbitMQ", "Arbitrer.RabbitMQ\Arbitrer.RabbitMQ.csproj", "{7BC4AE47-FEB5-4404-B027-A30FAF581833}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3AA78ADA-0BD6-43C1-A215-E2608D090B27}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cqrs.models", "tests\cqrs.models\cqrs.models.csproj", "{A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "receiver", "tests\receiver\receiver.csproj", "{ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "sender", "tests\sender\sender.csproj", "{D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Arbitrer.Kafka", "Arbitrer.Kafka\Arbitrer.Kafka.csproj", "{52E67D98-DE21-4434-AB34-5FF4FB70C5E7}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arbitrer.GRPC", "Arbitrer.GRPC\Arbitrer.GRPC.csproj", "{26449499-FBBC-4A2A-AE93-EB97A354BAA6}" @@ -33,18 +25,6 @@ Global {7BC4AE47-FEB5-4404-B027-A30FAF581833}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BC4AE47-FEB5-4404-B027-A30FAF581833}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BC4AE47-FEB5-4404-B027-A30FAF581833}.Release|Any CPU.Build.0 = Release|Any CPU - {A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858}.Release|Any CPU.Build.0 = Release|Any CPU - {ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA}.Release|Any CPU.Build.0 = Release|Any CPU - {D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB}.Release|Any CPU.Build.0 = Release|Any CPU {52E67D98-DE21-4434-AB34-5FF4FB70C5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {52E67D98-DE21-4434-AB34-5FF4FB70C5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {52E67D98-DE21-4434-AB34-5FF4FB70C5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -58,9 +38,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {A3CB6BBD-11F3-4F4F-A2F6-812BF6C62858} = {3AA78ADA-0BD6-43C1-A215-E2608D090B27} - {ABCBBD73-93A4-41B6-88AA-66B7EC20B9EA} = {3AA78ADA-0BD6-43C1-A215-E2608D090B27} - {D5052EFA-40F7-4F73-BE0D-F0BDA3130DCB} = {3AA78ADA-0BD6-43C1-A215-E2608D090B27} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EA2AB956-E48F-42AE-B669-D12BB549726A} diff --git a/tests/cqrs.models/Commands/MediatorNotification1.cs b/tests/cqrs.models/Commands/MediatorNotification1.cs deleted file mode 100644 index 95253b1..0000000 --- a/tests/cqrs.models/Commands/MediatorNotification1.cs +++ /dev/null @@ -1,7 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands; - -public class MediatorNotification1 : INotification -{ -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequest1.cs b/tests/cqrs.models/Commands/MediatrRequest1.cs deleted file mode 100644 index e9aa152..0000000 --- a/tests/cqrs.models/Commands/MediatrRequest1.cs +++ /dev/null @@ -1,7 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequest1: IRequest{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequest2.cs b/tests/cqrs.models/Commands/MediatrRequest2.cs deleted file mode 100644 index acc7663..0000000 --- a/tests/cqrs.models/Commands/MediatrRequest2.cs +++ /dev/null @@ -1,8 +0,0 @@ -using cqrs.models.Dto; -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequest2: IRequest{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequest3.cs b/tests/cqrs.models/Commands/MediatrRequest3.cs deleted file mode 100644 index d83c0a3..0000000 --- a/tests/cqrs.models/Commands/MediatrRequest3.cs +++ /dev/null @@ -1,8 +0,0 @@ -using cqrs.models.Dto; -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequest3: IRequest>{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequest4.cs b/tests/cqrs.models/Commands/MediatrRequest4.cs deleted file mode 100644 index 491bb1a..0000000 --- a/tests/cqrs.models/Commands/MediatrRequest4.cs +++ /dev/null @@ -1,7 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequest4: IRequest{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequest5.cs b/tests/cqrs.models/Commands/MediatrRequest5.cs deleted file mode 100644 index d065a49..0000000 --- a/tests/cqrs.models/Commands/MediatrRequest5.cs +++ /dev/null @@ -1,7 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequest5: IRequest{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequestWithException.cs b/tests/cqrs.models/Commands/MediatrRequestWithException.cs deleted file mode 100644 index 855bb63..0000000 --- a/tests/cqrs.models/Commands/MediatrRequestWithException.cs +++ /dev/null @@ -1,8 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands -{ - public class MediatRRequestWithException : IRequest - { - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequestWithHandleException.cs b/tests/cqrs.models/Commands/MediatrRequestWithHandleException.cs deleted file mode 100644 index 001feea..0000000 --- a/tests/cqrs.models/Commands/MediatrRequestWithHandleException.cs +++ /dev/null @@ -1,8 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands -{ - public class MediatRRequestWithHandlerException : IRequest - { - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Commands/MediatrRequestWithNoHandlers.cs b/tests/cqrs.models/Commands/MediatrRequestWithNoHandlers.cs deleted file mode 100644 index 4580ed5..0000000 --- a/tests/cqrs.models/Commands/MediatrRequestWithNoHandlers.cs +++ /dev/null @@ -1,7 +0,0 @@ -using MediatR; - -namespace cqrs.models.Commands{ - public class MediatRRequestWithNoHandlers: IRequest{ - - } -} \ No newline at end of file diff --git a/tests/cqrs.models/Dto/ResponseDTO.cs b/tests/cqrs.models/Dto/ResponseDTO.cs deleted file mode 100644 index c7910c7..0000000 --- a/tests/cqrs.models/Dto/ResponseDTO.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace cqrs.models.Dto; - -public class ResponseDTO -{ - public int Dtonumber { get; set; } = 1; - public string Test { get; set; } = "test"; -} \ No newline at end of file diff --git a/tests/cqrs.models/cqrs.models.csproj b/tests/cqrs.models/cqrs.models.csproj deleted file mode 100644 index 92a9d7f..0000000 --- a/tests/cqrs.models/cqrs.models.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/tests/receiver/Program.cs b/tests/receiver/Program.cs deleted file mode 100644 index 89be6c6..0000000 --- a/tests/receiver/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -using receiver; -using Arbitrer; -using MediatR; -using cqrs.models.Commands; -using System.Reflection; - -IHost host = Host.CreateDefaultBuilder(args) - .ConfigureServices((context, services) => - { - services.AddMediatR(cfg => { cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()); }); - services.AddArbitrer(opt => - { - opt.Behaviour = ArbitrerBehaviourEnum.Explicit; - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - opt.SetAsLocalRequest(); - - opt.ListenForNotification(); - }); - services.AddArbitrerRabbitMQMessageDispatcher(opt => context.Configuration.GetSection("rabbitmq").Bind(opt)); - // services.AddArbitrerKafkaMessageDispatcher(opt => context.Configuration.GetSection("kafka").Bind(opt)); - services.ResolveArbitrerCalls(); - - }) - .Build(); - -await host.RunAsync(); diff --git a/tests/receiver/Properties/launchSettings.json b/tests/receiver/Properties/launchSettings.json deleted file mode 100644 index c2c7a0a..0000000 --- a/tests/receiver/Properties/launchSettings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "profiles": { - "receiver": { - "commandName": "Project", - "dotnetRunMessages": true, - "environmentVariables": { - "DOTNET_ENVIRONMENT": "Development" - } - } - } -} diff --git a/tests/receiver/Worker.cs b/tests/receiver/Worker.cs deleted file mode 100644 index f49a768..0000000 --- a/tests/receiver/Worker.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace receiver; - -public class Worker : BackgroundService -{ - private readonly ILogger _logger; - - public Worker(ILogger logger) - { - _logger = logger; - } - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - while (!stoppingToken.IsCancellationRequested) - { - _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now); - await Task.Delay(1000, stoppingToken); - } - } -} diff --git a/tests/receiver/appsettings.Development.json b/tests/receiver/appsettings.Development.json deleted file mode 100644 index 6901764..0000000 --- a/tests/receiver/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/tests/receiver/appsettings.json b/tests/receiver/appsettings.json deleted file mode 100644 index 3ab56b8..0000000 --- a/tests/receiver/appsettings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "rabbitmq": { - "HostName": "localhost", - "UserName": "wt", - "Password": "123456/AP", - "VirtualHost": "/", - "Port": 5672 - }, - "kafka":{ - "BootstrapServers": "localhost:9092" - } -} \ No newline at end of file diff --git a/tests/receiver/handlers/CommandHandler.cs b/tests/receiver/handlers/CommandHandler.cs deleted file mode 100644 index 3daa2df..0000000 --- a/tests/receiver/handlers/CommandHandler.cs +++ /dev/null @@ -1,52 +0,0 @@ -using cqrs.models.Commands; -using cqrs.models.Dto; -using MediatR; - -namespace receiver.handlers -{ - public class CommandHandler : - IRequestHandler, - IRequestHandler, - IRequestHandler>, - IRequestHandler, - IRequestHandler, - IRequestHandler, - INotificationHandler - { - public Task Handle(MediatRRequest2 request, CancellationToken cancellationToken) - { - return Task.FromResult(new ResponseDTO()); - } - - public Task Handle(MediatRRequest1 request, CancellationToken cancellationToken) - { - return Task.FromResult(true); - } - - public Task Handle(MediatRRequestWithHandlerException request, CancellationToken cancellationToken) - { - throw new NotImplementedException(); - } - - public Task> Handle(MediatRRequest3 request, CancellationToken cancellationToken) - { - return Task.FromResult(new[] {new ResponseDTO()}.AsEnumerable()); - } - - public Task Handle(MediatorNotification1 notification, CancellationToken cancellationToken) - { - Console.WriteLine($"Notification received at : ${DateTime.Now.ToString("HH:mm:ss")}"); - return Task.CompletedTask; - } - - public async Task Handle(MediatRRequest4 request, CancellationToken cancellationToken) - { - return 9; - } - - public async Task Handle(MediatRRequest5 request, CancellationToken cancellationToken) - { - return 5; - } - } -} \ No newline at end of file diff --git a/tests/receiver/receiver.csproj b/tests/receiver/receiver.csproj deleted file mode 100644 index 17086da..0000000 --- a/tests/receiver/receiver.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - dotnet-receiver-95F2E0C5-AF42-474D-93C6-5E2EAF1F4511 - - - - - - - - - - - - - diff --git a/tests/sender/Program.cs b/tests/sender/Program.cs deleted file mode 100644 index 037f366..0000000 --- a/tests/sender/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -using sender; -using Arbitrer; -using cqrs.models.Commands; -using System.Reflection; -using MediatR; - - -IHost host = Host.CreateDefaultBuilder(args) - .ConfigureServices((context, services) => - { - services.AddMediatR(cfg => { cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()); }); - services.AddArbitrer(opt => - { - opt.Behaviour = ArbitrerBehaviourEnum.Explicit; - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - opt.SetAsRemoteRequest(); - }); - // services.AddArbitrerRabbitMQMessageDispatcher(opt => context.Configuration.GetSection("rabbitmq").Bind(opt)); - services.AddArbitrerKafkaMessageDispatcher(opt => context.Configuration.GetSection("kafka").Bind(opt)); - - services.AddHostedService(); - }) - .Build(); - - -await host.RunAsync(); \ No newline at end of file diff --git a/tests/sender/Properties/launchSettings.json b/tests/sender/Properties/launchSettings.json deleted file mode 100644 index 061876f..0000000 --- a/tests/sender/Properties/launchSettings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "profiles": { - "sender": { - "commandName": "Project", - "dotnetRunMessages": true, - "environmentVariables": { - "DOTNET_ENVIRONMENT": "Development" - } - } - } -} diff --git a/tests/sender/Worker.cs b/tests/sender/Worker.cs deleted file mode 100644 index 28020e8..0000000 --- a/tests/sender/Worker.cs +++ /dev/null @@ -1,120 +0,0 @@ -using MediatR; - -namespace sender; - -public class Worker : BackgroundService -{ - private readonly ILogger _logger; - - private readonly IServiceProvider provider; - - public Worker(ILogger logger, IServiceProvider provider) - { - _logger = logger; - this.provider = provider; - } - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - var mediatr = provider.CreateScope().ServiceProvider.GetRequiredService(); - while (!stoppingToken.IsCancellationRequested) - { - _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now); - - try - { - var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequest1(), stoppingToken); - _logger.LogInformation($"Operation succeded with {response}"); - } - catch (Exception ex) - { - _logger.LogError(exception: ex, "Error in remote request"); - } - - try - { - var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequest2(), stoppingToken); - _logger.LogInformation($"Operation succeded with {response}"); - } - catch (Exception ex) - { - _logger.LogError(exception: ex, "Error in remote request"); - } - - try - { - var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequest3(), stoppingToken); - _logger.LogInformation($"Operation succeded with {response}"); - } - catch (Exception ex) - { - _logger.LogError(exception: ex, "Error in remote request"); - } - - try - { - var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequest4(), stoppingToken); - _logger.LogInformation($"Operation succeded with {response}"); - } - catch (Exception ex) - { - _logger.LogError(exception: ex, "Error in remote request"); - } - - try - { - var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequest5(), stoppingToken); - _logger.LogInformation($"Operation succeded with {response}"); - } - catch (Exception ex) - { - _logger.LogError(exception: ex, "Error in remote request"); - } - - - // try - // { - // var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequestWithHandlerException(), stoppingToken); - // _logger.LogInformation($"Operation succeded with {response}"); - // } - // catch (Exception ex) - // { - // _logger.LogError(exception: ex, "Error in remote request MediatRRequestWithHandlerException"); - // } - - // try - // { - // var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequestWithException(), stoppingToken); - // _logger.LogInformation($"Operation succeded with {response}"); - // } - // catch (Exception ex) - // { - // _logger.LogError(exception: ex, "Error in remote request MediatRRequestWithException"); - // } - - - // try - // { - // await mediatr.Publish(new cqrs.models.Commands.MediatorNotification1(), stoppingToken); - // _logger.LogInformation($"Operation succeded "); - // } - // catch (Exception ex) - // { - // _logger.LogError(exception: ex, "Error in remote request MediatRRequestWithNoHandlers"); - // } - - // try - // { - // var response = await mediatr.Send(new cqrs.models.Commands.MediatRRequestWithNoHandlers(), stoppingToken); - // _logger.LogInformation($"Operation succeded with {response}"); - // } - // catch (Exception ex) - // { - // _logger.LogError(exception: ex, "Error in remote request MediatRRequestWithNoHandlers"); - // } - - - await Task.Delay(100, stoppingToken); - } - } -} \ No newline at end of file diff --git a/tests/sender/appsettings.Development.json b/tests/sender/appsettings.Development.json deleted file mode 100644 index 6901764..0000000 --- a/tests/sender/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/tests/sender/appsettings.json b/tests/sender/appsettings.json deleted file mode 100644 index 3cfd825..0000000 --- a/tests/sender/appsettings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.Hosting.Lifetime": "Information", - "Arbitrer": "Debug" - } - }, - "rabbitmq": { - "HostName": "localhost", - "UserName": "wt", - "Password": "123456/AP", - "VirtualHost": "indexer", - "Port": 5672, - "DeDuplicationTTL": 5000 - }, - "kafka":{ - "BootstrapServers": "localhost:9092" - } -} diff --git a/tests/sender/sender.csproj b/tests/sender/sender.csproj deleted file mode 100644 index 60e75df..0000000 --- a/tests/sender/sender.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - dotnet-sender-2903A8C6-AF7B-45C9-A99C-61648471A0E9 - - - - - - - - - - - - -