diff --git a/samples/KafkaFlow.Sample.BatchOperations/KafkaFlow.Sample.BatchOperations.csproj b/samples/KafkaFlow.Sample.BatchOperations/KafkaFlow.Sample.BatchOperations.csproj
index f51dbe58e..6336785ab 100644
--- a/samples/KafkaFlow.Sample.BatchOperations/KafkaFlow.Sample.BatchOperations.csproj
+++ b/samples/KafkaFlow.Sample.BatchOperations/KafkaFlow.Sample.BatchOperations.csproj
@@ -22,11 +22,9 @@
-
-
diff --git a/samples/KafkaFlow.Sample.BatchOperations/PrintConsoleMiddleware.cs b/samples/KafkaFlow.Sample.BatchOperations/PrintConsoleMiddleware.cs
index 317098b43..11d38754d 100644
--- a/samples/KafkaFlow.Sample.BatchOperations/PrintConsoleMiddleware.cs
+++ b/samples/KafkaFlow.Sample.BatchOperations/PrintConsoleMiddleware.cs
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using System.Threading.Tasks;
-using KafkaFlow.BatchConsume;
+using KafkaFlow.Middlewares.BatchConsume;
namespace KafkaFlow.Sample.BatchOperations;
diff --git a/samples/KafkaFlow.Sample.BatchOperations/Program.cs b/samples/KafkaFlow.Sample.BatchOperations/Program.cs
index 1515286ed..cf5b8eea8 100644
--- a/samples/KafkaFlow.Sample.BatchOperations/Program.cs
+++ b/samples/KafkaFlow.Sample.BatchOperations/Program.cs
@@ -1,7 +1,8 @@
using System;
using System.Linq;
using KafkaFlow;
-using KafkaFlow.BatchConsume;
+using KafkaFlow.Middlewares.BatchConsume;
+using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Producers;
using KafkaFlow.Sample.BatchOperations;
using KafkaFlow.Serializer;
diff --git a/samples/KafkaFlow.Sample.ConsumerThrottling/KafkaFlow.Sample.ConsumerThrottling.csproj b/samples/KafkaFlow.Sample.ConsumerThrottling/KafkaFlow.Sample.ConsumerThrottling.csproj
index 25d305383..8f607780f 100644
--- a/samples/KafkaFlow.Sample.ConsumerThrottling/KafkaFlow.Sample.ConsumerThrottling.csproj
+++ b/samples/KafkaFlow.Sample.ConsumerThrottling/KafkaFlow.Sample.ConsumerThrottling.csproj
@@ -22,7 +22,6 @@
-
diff --git a/samples/KafkaFlow.Sample.ConsumerThrottling/Program.cs b/samples/KafkaFlow.Sample.ConsumerThrottling/Program.cs
index 3e6699c70..2a1ce2b68 100644
--- a/samples/KafkaFlow.Sample.ConsumerThrottling/Program.cs
+++ b/samples/KafkaFlow.Sample.ConsumerThrottling/Program.cs
@@ -13,6 +13,8 @@ The ThrottleConsumer mechanism works by checking the lag of "consumerA" every 1
using System;
using System.Threading.Tasks;
using KafkaFlow;
+using KafkaFlow.Middlewares.Serializer;
+using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Producers;
using KafkaFlow.Serializer;
using Microsoft.Extensions.DependencyInjection;
diff --git a/samples/KafkaFlow.Sample.FlowControl/KafkaFlow.Sample.FlowControl.csproj b/samples/KafkaFlow.Sample.FlowControl/KafkaFlow.Sample.FlowControl.csproj
index e4a1914e1..20946db23 100644
--- a/samples/KafkaFlow.Sample.FlowControl/KafkaFlow.Sample.FlowControl.csproj
+++ b/samples/KafkaFlow.Sample.FlowControl/KafkaFlow.Sample.FlowControl.csproj
@@ -26,7 +26,6 @@
-
diff --git a/samples/KafkaFlow.Sample.FlowControl/Program.cs b/samples/KafkaFlow.Sample.FlowControl/Program.cs
index 87a783ce1..136d2126e 100644
--- a/samples/KafkaFlow.Sample.FlowControl/Program.cs
+++ b/samples/KafkaFlow.Sample.FlowControl/Program.cs
@@ -1,5 +1,6 @@
using System;
using KafkaFlow;
+using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Sample.FlowControl;
using KafkaFlow.Serializer;
using Microsoft.Extensions.DependencyInjection;
diff --git a/samples/KafkaFlow.Sample.PauseConsumerOnError/KafkaFlow.Sample.PauseConsumerOnError.csproj b/samples/KafkaFlow.Sample.PauseConsumerOnError/KafkaFlow.Sample.PauseConsumerOnError.csproj
index f6f6d1e42..71083617d 100644
--- a/samples/KafkaFlow.Sample.PauseConsumerOnError/KafkaFlow.Sample.PauseConsumerOnError.csproj
+++ b/samples/KafkaFlow.Sample.PauseConsumerOnError/KafkaFlow.Sample.PauseConsumerOnError.csproj
@@ -14,7 +14,6 @@
-
diff --git a/samples/KafkaFlow.Sample.PauseConsumerOnError/MessageHandler.cs b/samples/KafkaFlow.Sample.PauseConsumerOnError/MessageHandler.cs
index 114dae019..77b597265 100644
--- a/samples/KafkaFlow.Sample.PauseConsumerOnError/MessageHandler.cs
+++ b/samples/KafkaFlow.Sample.PauseConsumerOnError/MessageHandler.cs
@@ -1,4 +1,4 @@
-using KafkaFlow.TypedHandler;
+using KafkaFlow.Middlewares.TypedHandler;
namespace KafkaFlow.Sample.PauseConsumerOnError;
diff --git a/samples/KafkaFlow.Sample.PauseConsumerOnError/Program.cs b/samples/KafkaFlow.Sample.PauseConsumerOnError/Program.cs
index 478aa838b..14d8f0f03 100644
--- a/samples/KafkaFlow.Sample.PauseConsumerOnError/Program.cs
+++ b/samples/KafkaFlow.Sample.PauseConsumerOnError/Program.cs
@@ -1,8 +1,8 @@
using KafkaFlow;
+using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Producers;
using KafkaFlow.Sample.PauseConsumerOnError;
using KafkaFlow.Serializer;
-using KafkaFlow.TypedHandler;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler.cs b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler.cs
index f7f70e702..2325e42b0 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler.cs
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler.cs
@@ -1,9 +1,10 @@
-namespace KafkaFlow.Sample.SchemaRegistry.Handlers;
+using KafkaFlow.Middlewares.TypedHandler;
+
+namespace KafkaFlow.Sample.SchemaRegistry.Handlers;
using System;
using System.Threading.Tasks;
using global::SchemaRegistry;
-using TypedHandler;
public class AvroMessageHandler : IMessageHandler
{
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler2.cs b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler2.cs
index ab35a60e3..65660f5f3 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler2.cs
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/AvroMessageHandler2.cs
@@ -3,7 +3,7 @@
using System;
using System.Threading.Tasks;
using global::SchemaRegistry;
-using TypedHandler;
+using KafkaFlow.Middlewares.TypedHandler;
public class AvroMessageHandler2 : IMessageHandler
{
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/JsonMessageHandler.cs b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/JsonMessageHandler.cs
index f17b98a8b..39b446434 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/JsonMessageHandler.cs
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/JsonMessageHandler.cs
@@ -3,7 +3,7 @@
using System;
using System.Threading.Tasks;
using global::SchemaRegistry;
-using TypedHandler;
+using KafkaFlow.Middlewares.TypedHandler;
public class JsonMessageHandler : IMessageHandler
{
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/ProtobufMessageHandler.cs b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/ProtobufMessageHandler.cs
index aee7c1cd9..e1158c9c8 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/ProtobufMessageHandler.cs
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/Handlers/ProtobufMessageHandler.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
-using KafkaFlow.TypedHandler;
+using KafkaFlow.Middlewares.TypedHandler;
using SchemaRegistry;
namespace KafkaFlow.Sample.SchemaRegistry.Handlers;
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/KafkaFlow.Sample.SchemaRegistry.csproj b/samples/KafkaFlow.Sample.SchemaRegistry/KafkaFlow.Sample.SchemaRegistry.csproj
index 220139cdf..fbebfdb41 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/KafkaFlow.Sample.SchemaRegistry.csproj
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/KafkaFlow.Sample.SchemaRegistry.csproj
@@ -24,7 +24,6 @@
-
diff --git a/samples/KafkaFlow.Sample.SchemaRegistry/Program.cs b/samples/KafkaFlow.Sample.SchemaRegistry/Program.cs
index bc539818d..3e7c4c095 100644
--- a/samples/KafkaFlow.Sample.SchemaRegistry/Program.cs
+++ b/samples/KafkaFlow.Sample.SchemaRegistry/Program.cs
@@ -5,7 +5,6 @@
using KafkaFlow;
using KafkaFlow.Producers;
using KafkaFlow.Sample.SchemaRegistry.Handlers;
-using KafkaFlow.TypedHandler;
using Microsoft.Extensions.DependencyInjection;
using SchemaRegistry;
diff --git a/samples/KafkaFlow.Sample/KafkaFlow.Sample.csproj b/samples/KafkaFlow.Sample/KafkaFlow.Sample.csproj
index 1dfe8a114..ee83b36c3 100644
--- a/samples/KafkaFlow.Sample/KafkaFlow.Sample.csproj
+++ b/samples/KafkaFlow.Sample/KafkaFlow.Sample.csproj
@@ -19,12 +19,10 @@
-
-
diff --git a/samples/KafkaFlow.Sample/PrintConsoleHandler.cs b/samples/KafkaFlow.Sample/PrintConsoleHandler.cs
index 11276440c..57a1a48b8 100644
--- a/samples/KafkaFlow.Sample/PrintConsoleHandler.cs
+++ b/samples/KafkaFlow.Sample/PrintConsoleHandler.cs
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
-using KafkaFlow.TypedHandler;
+using KafkaFlow.Middlewares.TypedHandler;
namespace KafkaFlow.Sample;
diff --git a/samples/KafkaFlow.Sample/Program.cs b/samples/KafkaFlow.Sample/Program.cs
index 874962de1..eed68d674 100644
--- a/samples/KafkaFlow.Sample/Program.cs
+++ b/samples/KafkaFlow.Sample/Program.cs
@@ -1,10 +1,10 @@
using System;
using System.Threading.Tasks;
using KafkaFlow;
+using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Producers;
using KafkaFlow.Sample;
using KafkaFlow.Serializer;
-using KafkaFlow.TypedHandler;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
diff --git a/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs b/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs
index 4e8c00477..e5d99033d 100644
--- a/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Admin/Extensions/ClusterConfigurationBuilderExtensions.cs
@@ -6,7 +6,6 @@
using KafkaFlow.Admin.Handlers;
using KafkaFlow.Configuration;
using KafkaFlow.Serializer;
- using KafkaFlow.TypedHandler;
///
/// No needed
diff --git a/src/KafkaFlow.Admin/Handlers/ChangeConsumerWorkersCountHandler.cs b/src/KafkaFlow.Admin/Handlers/ChangeConsumerWorkersCountHandler.cs
index 370f418c6..4dbf0f7a0 100644
--- a/src/KafkaFlow.Admin/Handlers/ChangeConsumerWorkersCountHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/ChangeConsumerWorkersCountHandler.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.Admin.Handlers
using System.Threading.Tasks;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ChangeConsumerWorkersCountHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/ConsumerTelemetryMetricHandler.cs b/src/KafkaFlow.Admin/Handlers/ConsumerTelemetryMetricHandler.cs
index 0e7c038c9..e2b7fe36b 100644
--- a/src/KafkaFlow.Admin/Handlers/ConsumerTelemetryMetricHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/ConsumerTelemetryMetricHandler.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.Admin.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.Admin.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ConsumerTelemetryMetricHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/PauseConsumerByNameHandler.cs b/src/KafkaFlow.Admin/Handlers/PauseConsumerByNameHandler.cs
index c8bd71843..9afc8efdf 100644
--- a/src/KafkaFlow.Admin/Handlers/PauseConsumerByNameHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/PauseConsumerByNameHandler.cs
@@ -5,7 +5,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class PauseConsumerByNameHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/PauseConsumersByGroupHandler.cs b/src/KafkaFlow.Admin/Handlers/PauseConsumersByGroupHandler.cs
index a7aac4f2f..376393842 100644
--- a/src/KafkaFlow.Admin/Handlers/PauseConsumersByGroupHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/PauseConsumersByGroupHandler.cs
@@ -5,7 +5,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class PauseConsumersByGroupHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/ResetConsumerOffsetHandler.cs b/src/KafkaFlow.Admin/Handlers/ResetConsumerOffsetHandler.cs
index ca732a741..2d9c60008 100644
--- a/src/KafkaFlow.Admin/Handlers/ResetConsumerOffsetHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/ResetConsumerOffsetHandler.cs
@@ -7,7 +7,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ResetConsumerOffsetHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/RestartConsumerByNameHandler.cs b/src/KafkaFlow.Admin/Handlers/RestartConsumerByNameHandler.cs
index 82316a519..3525bf490 100644
--- a/src/KafkaFlow.Admin/Handlers/RestartConsumerByNameHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/RestartConsumerByNameHandler.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.Admin.Handlers
using System.Threading.Tasks;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class RestartConsumerByNameHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/ResumeConsumerByNameHandler.cs b/src/KafkaFlow.Admin/Handlers/ResumeConsumerByNameHandler.cs
index dfbd14f11..e8eb336ff 100644
--- a/src/KafkaFlow.Admin/Handlers/ResumeConsumerByNameHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/ResumeConsumerByNameHandler.cs
@@ -5,7 +5,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ResumeConsumerByNameHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/ResumeConsumersByGroupHandler.cs b/src/KafkaFlow.Admin/Handlers/ResumeConsumersByGroupHandler.cs
index 5aa6f3898..553d2ca23 100644
--- a/src/KafkaFlow.Admin/Handlers/ResumeConsumersByGroupHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/ResumeConsumersByGroupHandler.cs
@@ -5,7 +5,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ResumeConsumersByGroupHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/RewindConsumerOffsetToDateTimeHandler.cs b/src/KafkaFlow.Admin/Handlers/RewindConsumerOffsetToDateTimeHandler.cs
index 83712ab40..b5895ef56 100644
--- a/src/KafkaFlow.Admin/Handlers/RewindConsumerOffsetToDateTimeHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/RewindConsumerOffsetToDateTimeHandler.cs
@@ -7,7 +7,7 @@ namespace KafkaFlow.Admin.Handlers
using KafkaFlow.Admin.Extensions;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class RewindConsumerOffsetToDateTimeHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/StartConsumerByNameHandler.cs b/src/KafkaFlow.Admin/Handlers/StartConsumerByNameHandler.cs
index 4189c2814..b7ad5fa08 100644
--- a/src/KafkaFlow.Admin/Handlers/StartConsumerByNameHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/StartConsumerByNameHandler.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.Admin.Handlers
using System.Threading.Tasks;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class StartConsumerByNameHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/Handlers/StopConsumerByNameHandler.cs b/src/KafkaFlow.Admin/Handlers/StopConsumerByNameHandler.cs
index 203f4faf7..92a9fc0a0 100644
--- a/src/KafkaFlow.Admin/Handlers/StopConsumerByNameHandler.cs
+++ b/src/KafkaFlow.Admin/Handlers/StopConsumerByNameHandler.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.Admin.Handlers
using System.Threading.Tasks;
using KafkaFlow.Admin.Messages;
using KafkaFlow.Consumers;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class StopConsumerByNameHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.Admin/KafkaFlow.Admin.csproj b/src/KafkaFlow.Admin/KafkaFlow.Admin.csproj
index 58d220888..5be79f73e 100644
--- a/src/KafkaFlow.Admin/KafkaFlow.Admin.csproj
+++ b/src/KafkaFlow.Admin/KafkaFlow.Admin.csproj
@@ -9,7 +9,6 @@
-
diff --git a/src/KafkaFlow.BatchConsume/AssemblyInfo.cs b/src/KafkaFlow.BatchConsume/AssemblyInfo.cs
deleted file mode 100644
index f8402e685..000000000
--- a/src/KafkaFlow.BatchConsume/AssemblyInfo.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("KafkaFlow.UnitTests")]
-[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
diff --git a/src/KafkaFlow.BatchConsume/KafkaFlow.BatchConsume.csproj b/src/KafkaFlow.BatchConsume/KafkaFlow.BatchConsume.csproj
deleted file mode 100644
index cd42c7410..000000000
--- a/src/KafkaFlow.BatchConsume/KafkaFlow.BatchConsume.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- netstandard2.0
- KafkaFlow.BatchConsume
- A KafkaFlow middleware to consume messages in batches
-
-
-
-
-
-
-
-
diff --git a/src/KafkaFlow.Compressor/ConfigurationBuilderExtensions.cs b/src/KafkaFlow.Compressor/ConfigurationBuilderExtensions.cs
deleted file mode 100644
index eb5e83f5b..000000000
--- a/src/KafkaFlow.Compressor/ConfigurationBuilderExtensions.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-namespace KafkaFlow.Compressor
-{
- using System;
- using KafkaFlow.Configuration;
-
- ///
- /// Extension methods for and .
- ///
- public static class ConfigurationBuilderExtensions
- {
- ///
- /// Registers a middleware to decompress the message
- ///
- /// The middleware configuration builder
- /// The compressor type
- ///
- [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
- public static IConsumerMiddlewareConfigurationBuilder AddCompressor(this IConsumerMiddlewareConfigurationBuilder middlewares)
- where T : class, IMessageCompressor
- {
- middlewares.DependencyConfigurator.AddTransient();
- return middlewares.AddCompressor(resolver => resolver.Resolve());
- }
-
- ///
- /// Registers a middleware to decompress the message
- ///
- /// The middleware configuration builder
- /// The compressor type that implements
- /// A factory to create the instance
- ///
- [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
- public static IConsumerMiddlewareConfigurationBuilder AddCompressor(
- this IConsumerMiddlewareConfigurationBuilder middlewares,
- Factory factory)
- where T : class, IMessageCompressor
- {
- return middlewares.Add(resolver => new CompressorConsumerMiddleware(factory(resolver)));
- }
-
- ///
- /// Registers a middleware to compress the message
- /// It is highly recommended to use the producer native compression ('WithCompression()' method) instead of using the compressor middleware
- ///
- /// The middleware configuration builder
- /// The compressor type that implements
- ///
- [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
- public static IProducerMiddlewareConfigurationBuilder AddCompressor(this IProducerMiddlewareConfigurationBuilder middlewares)
- where T : class, IMessageCompressor
- {
- middlewares.DependencyConfigurator.AddTransient();
- return middlewares.AddCompressor(resolver => resolver.Resolve());
- }
-
- ///
- /// Registers a middleware to compress the message
- /// It is highly recommended to use the producer native compression ('WithCompression()' method) instead of using the compressor middleware
- ///
- /// The middleware configuration builder
- /// The compressor type that implements
- /// A factory to create the instance
- ///
- [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
- public static IProducerMiddlewareConfigurationBuilder AddCompressor(
- this IProducerMiddlewareConfigurationBuilder middlewares,
- Factory factory)
- where T : class, IMessageCompressor
- {
- return middlewares.Add(resolver => new CompressorProducerMiddleware(factory(resolver)));
- }
- }
-}
diff --git a/src/KafkaFlow.Compressor/KafkaFlow.Compressor.csproj b/src/KafkaFlow.Compressor/KafkaFlow.Compressor.csproj
deleted file mode 100644
index d9ceb3efe..000000000
--- a/src/KafkaFlow.Compressor/KafkaFlow.Compressor.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- netstandard2.0
- KafkaFlow.Compressor
- Compression middleware for KafkaFlow
-
-
-
-
-
-
-
diff --git a/src/KafkaFlow.IntegrationTests/Core/Bootstrapper.cs b/src/KafkaFlow.IntegrationTests/Core/Bootstrapper.cs
index 293d8c60b..b2e963ea9 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Bootstrapper.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Bootstrapper.cs
@@ -9,15 +9,14 @@ namespace KafkaFlow.IntegrationTests.Core
using global::Microsoft.Extensions.Configuration;
using global::Microsoft.Extensions.DependencyInjection;
using global::Microsoft.Extensions.Hosting;
- using KafkaFlow.Compressor;
using KafkaFlow.Compressor.Gzip;
using KafkaFlow.IntegrationTests.Core.Handlers;
using KafkaFlow.IntegrationTests.Core.Messages;
using KafkaFlow.IntegrationTests.Core.Middlewares;
using KafkaFlow.IntegrationTests.Core.Producers;
+ using KafkaFlow.Middlewares.Serializer.Configuration;
using KafkaFlow.Serializer;
using KafkaFlow.Serializer.SchemaRegistry;
- using KafkaFlow.TypedHandler;
using AutoOffsetReset = KafkaFlow.AutoOffsetReset;
internal static class Bootstrapper
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/AvroMessageHandler.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/AvroMessageHandler.cs
index 23994a0d9..feb76b1f8 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/AvroMessageHandler.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/AvroMessageHandler.cs
@@ -1,7 +1,7 @@
namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
using MessageTypes;
internal class AvroMessageHandler : IMessageHandler
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentJsonMessageHandler.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentJsonMessageHandler.cs
index f049242a5..22e12e1cc 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentJsonMessageHandler.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentJsonMessageHandler.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ConfluentJsonMessageHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentProtobufMessageHandler.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentProtobufMessageHandler.cs
index 192e09bbb..697efca9f 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentProtobufMessageHandler.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/ConfluentProtobufMessageHandler.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class ConfluentProtobufMessageHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler.cs
index a5f77c0ae..f2d1bb484 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class MessageHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler1.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler1.cs
index c33518e09..1b01e1ea0 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler1.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler1.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class MessageHandler1 : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler2.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler2.cs
index 38534e1c0..f47f02638 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler2.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/MessageHandler2.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
using System;
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class MessageHandler2 : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/Core/Handlers/PauseResumeHandler.cs b/src/KafkaFlow.IntegrationTests/Core/Handlers/PauseResumeHandler.cs
index f58772786..05ccf1350 100644
--- a/src/KafkaFlow.IntegrationTests/Core/Handlers/PauseResumeHandler.cs
+++ b/src/KafkaFlow.IntegrationTests/Core/Handlers/PauseResumeHandler.cs
@@ -2,7 +2,7 @@ namespace KafkaFlow.IntegrationTests.Core.Handlers
{
using System.Threading.Tasks;
using KafkaFlow.IntegrationTests.Core.Messages;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
internal class PauseResumeHandler : IMessageHandler
{
diff --git a/src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj b/src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj
index 6d3a8f87f..79e8042a0 100644
--- a/src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj
+++ b/src/KafkaFlow.IntegrationTests/KafkaFlow.IntegrationTests.csproj
@@ -35,14 +35,12 @@
-
-
diff --git a/src/KafkaFlow.SchemaRegistry/KafkaFlow.SchemaRegistry.csproj b/src/KafkaFlow.SchemaRegistry/KafkaFlow.SchemaRegistry.csproj
index b1241a6fb..d7aa2a489 100644
--- a/src/KafkaFlow.SchemaRegistry/KafkaFlow.SchemaRegistry.csproj
+++ b/src/KafkaFlow.SchemaRegistry/KafkaFlow.SchemaRegistry.csproj
@@ -9,12 +9,12 @@
-
+
-
+
diff --git a/src/KafkaFlow.SchemaRegistry/SchemaRegistryTypeResolver.cs b/src/KafkaFlow.SchemaRegistry/SchemaRegistryTypeResolver.cs
index 20185edc4..c13a237de 100644
--- a/src/KafkaFlow.SchemaRegistry/SchemaRegistryTypeResolver.cs
+++ b/src/KafkaFlow.SchemaRegistry/SchemaRegistryTypeResolver.cs
@@ -6,6 +6,7 @@ namespace KafkaFlow
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
///
/// The message type resolver to be used with schema registry serializers
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ConsumerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ConsumerConfigurationBuilderExtensions.cs
index 81ac47435..ba2862b8d 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ConsumerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ConsumerConfigurationBuilderExtensions.cs
@@ -2,6 +2,7 @@
{
using Confluent.SchemaRegistry;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro.csproj b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro.csproj
index 355666973..e65dfa824 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro.csproj
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro.csproj
@@ -10,7 +10,6 @@
-
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ProducerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ProducerConfigurationBuilderExtensions.cs
index d60a7a39c..54bf6bac7 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ProducerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentAvro/ProducerConfigurationBuilderExtensions.cs
@@ -3,6 +3,7 @@
using Confluent.SchemaRegistry;
using Confluent.SchemaRegistry.Serdes;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ConsumerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ConsumerConfigurationBuilderExtensions.cs
index 06c8c04b9..9928afd6b 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ConsumerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ConsumerConfigurationBuilderExtensions.cs
@@ -1,6 +1,8 @@
namespace KafkaFlow
{
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson.csproj b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson.csproj
index c7e599371..305788443 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson.csproj
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson.csproj
@@ -15,7 +15,6 @@
-
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ProducerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ProducerConfigurationBuilderExtensions.cs
index 1708eea73..31a7f35f0 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ProducerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentJson/ProducerConfigurationBuilderExtensions.cs
@@ -2,6 +2,8 @@
{
using Confluent.SchemaRegistry.Serdes;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ConsumerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ConsumerConfigurationBuilderExtensions.cs
index ce3b0e4c3..2c0f88223 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ConsumerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ConsumerConfigurationBuilderExtensions.cs
@@ -2,6 +2,7 @@
{
using Confluent.SchemaRegistry;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf.csproj b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf.csproj
index f2eac2e3b..418a3ccd7 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf.csproj
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf.csproj
@@ -16,6 +16,5 @@
-
diff --git a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ProducerConfigurationBuilderExtensions.cs b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ProducerConfigurationBuilderExtensions.cs
index fc59f5e3d..af83cd19d 100644
--- a/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ProducerConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow.Serializer.SchemaRegistry.ConfluentProtobuf/ProducerConfigurationBuilderExtensions.cs
@@ -3,6 +3,7 @@
using Confluent.SchemaRegistry;
using Confluent.SchemaRegistry.Serdes;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer;
using KafkaFlow.Serializer.SchemaRegistry;
///
diff --git a/src/KafkaFlow.Serializer/KafkaFlow.Serializer.csproj b/src/KafkaFlow.Serializer/KafkaFlow.Serializer.csproj
deleted file mode 100644
index d0e384d2f..000000000
--- a/src/KafkaFlow.Serializer/KafkaFlow.Serializer.csproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- netstandard2.0
- KafkaFlow.Serializer
- Serializer middleware for KafkaFlow
- KafkaFlow
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/KafkaFlow.TypedHandler/AssemblyInfo.cs b/src/KafkaFlow.TypedHandler/AssemblyInfo.cs
deleted file mode 100644
index f8402e685..000000000
--- a/src/KafkaFlow.TypedHandler/AssemblyInfo.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo("KafkaFlow.UnitTests")]
-[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
diff --git a/src/KafkaFlow.TypedHandler/ConfigurationBuilderExtensions.cs b/src/KafkaFlow.TypedHandler/ConfigurationBuilderExtensions.cs
deleted file mode 100644
index de119b733..000000000
--- a/src/KafkaFlow.TypedHandler/ConfigurationBuilderExtensions.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace KafkaFlow.TypedHandler
-{
- using System;
- using KafkaFlow.Configuration;
-
- ///
- /// Extension methods over
- ///
- public static class ConfigurationBuilderExtensions
- {
- ///
- /// Adds typed handler middleware
- ///
- /// Instance of
- /// A handler to configure the middleware
- ///
- public static IConsumerMiddlewareConfigurationBuilder AddTypedHandlers(
- this IConsumerMiddlewareConfigurationBuilder builder,
- Action configure)
- {
- var typedHandlerBuilder = new TypedHandlerConfigurationBuilder(builder.DependencyConfigurator);
-
- configure(typedHandlerBuilder);
-
- var configuration = typedHandlerBuilder.Build();
-
- builder.Add(
- resolver => new TypedHandlerMiddleware(resolver, configuration),
- MiddlewareLifetime.Scoped);
-
- return builder;
- }
- }
-}
diff --git a/src/KafkaFlow.TypedHandler/KafkaFlow.TypedHandler.csproj b/src/KafkaFlow.TypedHandler/KafkaFlow.TypedHandler.csproj
deleted file mode 100644
index 260ab8c41..000000000
--- a/src/KafkaFlow.TypedHandler/KafkaFlow.TypedHandler.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- netstandard2.0
- KafkaFlow.TypedHandler
- A KafkaFlow middleware to execute a handler class when a specific message arrives
-
-
-
-
-
-
-
diff --git a/src/KafkaFlow.UnitTests/BatchConsume/BatchConsumeMiddlewareTests.cs b/src/KafkaFlow.UnitTests/BatchConsume/BatchConsumeMiddlewareTests.cs
index 5e75f3c4d..287aae481 100644
--- a/src/KafkaFlow.UnitTests/BatchConsume/BatchConsumeMiddlewareTests.cs
+++ b/src/KafkaFlow.UnitTests/BatchConsume/BatchConsumeMiddlewareTests.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.UnitTests.BatchConsume
using System;
using System.Threading.Tasks;
using FluentAssertions;
- using KafkaFlow.BatchConsume;
+ using KafkaFlow.Middlewares.BatchConsume;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
diff --git a/src/KafkaFlow.UnitTests/Compressors/CompressorConsumerMiddlewareTests.cs b/src/KafkaFlow.UnitTests/Compressors/CompressorConsumerMiddlewareTests.cs
index ce2808cb2..04417ccad 100644
--- a/src/KafkaFlow.UnitTests/Compressors/CompressorConsumerMiddlewareTests.cs
+++ b/src/KafkaFlow.UnitTests/Compressors/CompressorConsumerMiddlewareTests.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.UnitTests.Compressors
using System;
using System.Threading.Tasks;
using FluentAssertions;
- using KafkaFlow.Compressor;
+ using KafkaFlow.Middlewares.Compression;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
diff --git a/src/KafkaFlow.UnitTests/Compressors/CompressorProducerMiddlewareTests.cs b/src/KafkaFlow.UnitTests/Compressors/CompressorProducerMiddlewareTests.cs
index 54b135a70..df1de6aca 100644
--- a/src/KafkaFlow.UnitTests/Compressors/CompressorProducerMiddlewareTests.cs
+++ b/src/KafkaFlow.UnitTests/Compressors/CompressorProducerMiddlewareTests.cs
@@ -3,7 +3,7 @@ namespace KafkaFlow.UnitTests.Compressors
using System;
using System.Threading.Tasks;
using FluentAssertions;
- using KafkaFlow.Compressor;
+ using KafkaFlow.Middlewares.Compression;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
diff --git a/src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj b/src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj
index f8e053443..a47c494e6 100644
--- a/src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj
+++ b/src/KafkaFlow.UnitTests/KafkaFlow.UnitTests.csproj
@@ -31,11 +31,8 @@
-
-
-
diff --git a/src/KafkaFlow.UnitTests/Serializers/SerializerConsumerMiddlewareTests.cs b/src/KafkaFlow.UnitTests/Serializers/SerializerConsumerMiddlewareTests.cs
index 117cd9f50..9d03646ce 100644
--- a/src/KafkaFlow.UnitTests/Serializers/SerializerConsumerMiddlewareTests.cs
+++ b/src/KafkaFlow.UnitTests/Serializers/SerializerConsumerMiddlewareTests.cs
@@ -4,6 +4,8 @@ namespace KafkaFlow.UnitTests.Serializers
using System.IO;
using System.Threading.Tasks;
using FluentAssertions;
+ using KafkaFlow.Middlewares.Serializer;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
diff --git a/src/KafkaFlow.UnitTests/Serializers/SerializerProducerMiddlewareTests.cs b/src/KafkaFlow.UnitTests/Serializers/SerializerProducerMiddlewareTests.cs
index 0b45b7a1e..9e46816df 100644
--- a/src/KafkaFlow.UnitTests/Serializers/SerializerProducerMiddlewareTests.cs
+++ b/src/KafkaFlow.UnitTests/Serializers/SerializerProducerMiddlewareTests.cs
@@ -5,6 +5,8 @@ namespace KafkaFlow.UnitTests.Serializers
using System.Threading.Tasks;
using AutoFixture;
using FluentAssertions;
+ using KafkaFlow.Middlewares.Serializer;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
diff --git a/src/KafkaFlow.UnitTests/TypedHandler/HandlerTypeMappingTests.cs b/src/KafkaFlow.UnitTests/TypedHandler/HandlerTypeMappingTests.cs
index 48f4ba6ca..90856c544 100644
--- a/src/KafkaFlow.UnitTests/TypedHandler/HandlerTypeMappingTests.cs
+++ b/src/KafkaFlow.UnitTests/TypedHandler/HandlerTypeMappingTests.cs
@@ -1,7 +1,7 @@
namespace KafkaFlow.UnitTests.TypedHandler
{
using FluentAssertions;
- using KafkaFlow.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
diff --git a/src/KafkaFlow.sln b/src/KafkaFlow.sln
index a3012d169..99c570755 100644
--- a/src/KafkaFlow.sln
+++ b/src/KafkaFlow.sln
@@ -25,12 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compression", "Compression"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Abstractions", "KafkaFlow.Abstractions\KafkaFlow.Abstractions.csproj", "{88808771-56BE-422B-94DC-7AB070F64E98}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.TypedHandler", "KafkaFlow.TypedHandler\KafkaFlow.TypedHandler.csproj", "{E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Serializer", "KafkaFlow.Serializer\KafkaFlow.Serializer.csproj", "{B7197114-B1C7-49EC-8740-1E09233B2C40}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Compressor", "KafkaFlow.Compressor\KafkaFlow.Compressor.csproj", "{D29EC709-33DE-4045-8F3B-EC6619CDB429}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.IntegrationTests", "KafkaFlow.IntegrationTests\KafkaFlow.IntegrationTests.csproj", "{36F459F4-8323-472A-A8C5-8C9D89F92012}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Serializer.NewtonsoftJson", "KafkaFlow.Serializer.NewtonsoftJson\KafkaFlow.Serializer.NewtonsoftJson.csproj", "{FC622AB0-6481-4249-8D83-27BC39912103}"
@@ -59,8 +53,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Serializer.Schema
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Middlewares", "Middlewares", "{ED24B548-6F37-4283-A35B-F6015BFB7A34}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.BatchConsume", "KafkaFlow.BatchConsume\KafkaFlow.BatchConsume.csproj", "{C891D0DB-BE19-4D20-9E2F-61D413210F8D}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Sample.BatchOperations", "..\samples\KafkaFlow.Sample.BatchOperations\KafkaFlow.Sample.BatchOperations.csproj", "{DE8A8871-B19E-489D-8292-386A06A4CDFA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KafkaFlow.Extensions.Hosting", "KafkaFlow.Extensions.Hosting\KafkaFlow.Extensions.Hosting.csproj", "{7913342E-80FD-4094-B892-18DAA2E6948F}"
@@ -121,18 +113,6 @@ Global
{88808771-56BE-422B-94DC-7AB070F64E98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88808771-56BE-422B-94DC-7AB070F64E98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88808771-56BE-422B-94DC-7AB070F64E98}.Release|Any CPU.Build.0 = Release|Any CPU
- {E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE}.Release|Any CPU.Build.0 = Release|Any CPU
- {B7197114-B1C7-49EC-8740-1E09233B2C40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B7197114-B1C7-49EC-8740-1E09233B2C40}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B7197114-B1C7-49EC-8740-1E09233B2C40}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B7197114-B1C7-49EC-8740-1E09233B2C40}.Release|Any CPU.Build.0 = Release|Any CPU
- {D29EC709-33DE-4045-8F3B-EC6619CDB429}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D29EC709-33DE-4045-8F3B-EC6619CDB429}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D29EC709-33DE-4045-8F3B-EC6619CDB429}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D29EC709-33DE-4045-8F3B-EC6619CDB429}.Release|Any CPU.Build.0 = Release|Any CPU
{36F459F4-8323-472A-A8C5-8C9D89F92012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36F459F4-8323-472A-A8C5-8C9D89F92012}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36F459F4-8323-472A-A8C5-8C9D89F92012}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -173,10 +153,6 @@ Global
{2E63A019-F8AD-4EC3-A80A-F560DEC7C5B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E63A019-F8AD-4EC3-A80A-F560DEC7C5B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E63A019-F8AD-4EC3-A80A-F560DEC7C5B4}.Release|Any CPU.Build.0 = Release|Any CPU
- {C891D0DB-BE19-4D20-9E2F-61D413210F8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C891D0DB-BE19-4D20-9E2F-61D413210F8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C891D0DB-BE19-4D20-9E2F-61D413210F8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C891D0DB-BE19-4D20-9E2F-61D413210F8D}.Release|Any CPU.Build.0 = Release|Any CPU
{DE8A8871-B19E-489D-8292-386A06A4CDFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE8A8871-B19E-489D-8292-386A06A4CDFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE8A8871-B19E-489D-8292-386A06A4CDFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -238,9 +214,6 @@ Global
{ADAAA63C-E17C-4F1B-A062-3CCA071D75C2} = {ED24B548-6F37-4283-A35B-F6015BFB7A34}
{0A782A83-B66D-4B99-9BE2-2B18AAD2E03C} = {ED24B548-6F37-4283-A35B-F6015BFB7A34}
{88808771-56BE-422B-94DC-7AB070F64E98} = {068CB250-2804-4C7E-9490-17F432B9CE21}
- {E47EF9E0-A1C7-4FF0-AEC5-143F52ED0FBE} = {ED24B548-6F37-4283-A35B-F6015BFB7A34}
- {B7197114-B1C7-49EC-8740-1E09233B2C40} = {ADAAA63C-E17C-4F1B-A062-3CCA071D75C2}
- {D29EC709-33DE-4045-8F3B-EC6619CDB429} = {0A782A83-B66D-4B99-9BE2-2B18AAD2E03C}
{36F459F4-8323-472A-A8C5-8C9D89F92012} = {7A9B997B-DAAC-4004-94F3-32F6B88E0068}
{FC622AB0-6481-4249-8D83-27BC39912103} = {ADAAA63C-E17C-4F1B-A062-3CCA071D75C2}
{B86A51E3-7AC9-4EF8-BD2A-1ACC9EF0F5AE} = {292BCEDD-55B4-49BB-B8B2-24CD834FF2AA}
@@ -251,7 +224,6 @@ Global
{827620D3-2258-410E-A79E-E782ED42284C} = {58483813-0D7C-423E-8E7D-8FBF3E6CDB6D}
{15C12D0C-FE8A-41F9-BBCF-5A963F05D5C7} = {303AE78F-6C96-4DF4-AC89-5C4FD53AFF0B}
{2E63A019-F8AD-4EC3-A80A-F560DEC7C5B4} = {ADAAA63C-E17C-4F1B-A062-3CCA071D75C2}
- {C891D0DB-BE19-4D20-9E2F-61D413210F8D} = {ED24B548-6F37-4283-A35B-F6015BFB7A34}
{DE8A8871-B19E-489D-8292-386A06A4CDFA} = {303AE78F-6C96-4DF4-AC89-5C4FD53AFF0B}
{7913342E-80FD-4094-B892-18DAA2E6948F} = {068CB250-2804-4C7E-9490-17F432B9CE21}
{98C9826C-76F6-4C21-8A32-D55C2647905B} = {ADAAA63C-E17C-4F1B-A062-3CCA071D75C2}
diff --git a/src/KafkaFlow/Extensions/ConfigurationBuilderExtensions.cs b/src/KafkaFlow/Extensions/ConfigurationBuilderExtensions.cs
index 1d8841142..2662ed86a 100644
--- a/src/KafkaFlow/Extensions/ConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow/Extensions/ConfigurationBuilderExtensions.cs
@@ -4,6 +4,9 @@ namespace KafkaFlow
using System.Collections.Generic;
using Confluent.Kafka;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Compression;
+ using KafkaFlow.Middlewares.TypedHandler;
+ using KafkaFlow.Middlewares.TypedHandler.Configuration;
///
/// Provides extension methods over and
@@ -120,5 +123,90 @@ public static IProducerConfigurationBuilder WithCustomFactory(
{
return ((ProducerConfigurationBuilder) builder).WithCustomFactory(decoratorFactory);
}
+
+ ///
+ /// Adds typed handler middleware
+ ///
+ /// Instance of
+ /// A handler to configure the middleware
+ ///
+ public static IConsumerMiddlewareConfigurationBuilder AddTypedHandlers(
+ this IConsumerMiddlewareConfigurationBuilder builder,
+ Action configure)
+ {
+ var typedHandlerBuilder = new TypedHandlerConfigurationBuilder(builder.DependencyConfigurator);
+
+ configure(typedHandlerBuilder);
+
+ var configuration = typedHandlerBuilder.Build();
+
+ builder.Add(
+ resolver => new TypedHandlerMiddleware(resolver, configuration),
+ MiddlewareLifetime.Scoped);
+
+ return builder;
+ }
+
+ ///
+ /// Registers a middleware to decompress the message
+ ///
+ /// The middleware configuration builder
+ /// The compressor type
+ ///
+ [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
+ public static IConsumerMiddlewareConfigurationBuilder AddCompressor(this IConsumerMiddlewareConfigurationBuilder middlewares)
+ where T : class, IMessageCompressor
+ {
+ middlewares.DependencyConfigurator.AddTransient();
+ return middlewares.AddCompressor(resolver => resolver.Resolve());
+ }
+
+ ///
+ /// Registers a middleware to decompress the message
+ ///
+ /// The middleware configuration builder
+ /// The compressor type that implements
+ /// A factory to create the instance
+ ///
+ [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
+ public static IConsumerMiddlewareConfigurationBuilder AddCompressor(
+ this IConsumerMiddlewareConfigurationBuilder middlewares,
+ Factory factory)
+ where T : class, IMessageCompressor
+ {
+ return middlewares.Add(resolver => new CompressorConsumerMiddleware(factory(resolver)));
+ }
+
+ ///
+ /// Registers a middleware to compress the message
+ /// It is highly recommended to use the producer native compression ('WithCompression()' method) instead of using the compressor middleware
+ ///
+ /// The middleware configuration builder
+ /// The compressor type that implements
+ ///
+ [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
+ public static IProducerMiddlewareConfigurationBuilder AddCompressor(this IProducerMiddlewareConfigurationBuilder middlewares)
+ where T : class, IMessageCompressor
+ {
+ middlewares.DependencyConfigurator.AddTransient();
+ return middlewares.AddCompressor(resolver => resolver.Resolve());
+ }
+
+ ///
+ /// Registers a middleware to compress the message
+ /// It is highly recommended to use the producer native compression ('WithCompression()' method) instead of using the compressor middleware
+ ///
+ /// The middleware configuration builder
+ /// The compressor type that implements
+ /// A factory to create the instance
+ ///
+ [Obsolete("Compressors should only be used in backward compatibility scenarios, in the vast majority of cases native compression (producer.WithCompression()) should be used instead")]
+ public static IProducerMiddlewareConfigurationBuilder AddCompressor(
+ this IProducerMiddlewareConfigurationBuilder middlewares,
+ Factory factory)
+ where T : class, IMessageCompressor
+ {
+ return middlewares.Add(resolver => new CompressorProducerMiddleware(factory(resolver)));
+ }
}
}
diff --git a/src/KafkaFlow/KafkaFlow.csproj b/src/KafkaFlow/KafkaFlow.csproj
index ddf21310f..a05e5e9e3 100644
--- a/src/KafkaFlow/KafkaFlow.csproj
+++ b/src/KafkaFlow/KafkaFlow.csproj
@@ -8,7 +8,9 @@
+
+
diff --git a/src/KafkaFlow.BatchConsume/BatchConsumeExtensions.cs b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeExtensions.cs
similarity index 97%
rename from src/KafkaFlow.BatchConsume/BatchConsumeExtensions.cs
rename to src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeExtensions.cs
index 1bbe085da..d9c7613cb 100644
--- a/src/KafkaFlow.BatchConsume/BatchConsumeExtensions.cs
+++ b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeExtensions.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.BatchConsume
+namespace KafkaFlow.Middlewares.BatchConsume
{
using System;
using System.Collections.Generic;
diff --git a/src/KafkaFlow.BatchConsume/BatchConsumeMessageContext.cs b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMessageContext.cs
similarity index 95%
rename from src/KafkaFlow.BatchConsume/BatchConsumeMessageContext.cs
rename to src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMessageContext.cs
index 0087fd6ca..aef603c68 100644
--- a/src/KafkaFlow.BatchConsume/BatchConsumeMessageContext.cs
+++ b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMessageContext.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.BatchConsume
+namespace KafkaFlow.Middlewares.BatchConsume
{
using System;
using System.Collections.Generic;
diff --git a/src/KafkaFlow.BatchConsume/BatchConsumeMiddleware.cs b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMiddleware.cs
similarity index 98%
rename from src/KafkaFlow.BatchConsume/BatchConsumeMiddleware.cs
rename to src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMiddleware.cs
index 4f61f6626..02fd02dce 100644
--- a/src/KafkaFlow.BatchConsume/BatchConsumeMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/BatchConsume/BatchConsumeMiddleware.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.BatchConsume
+namespace KafkaFlow.Middlewares.BatchConsume
{
using System;
using System.Collections.Generic;
diff --git a/src/KafkaFlow.Compressor/CompressorConsumerMiddleware.cs b/src/KafkaFlow/Middlewares/Compression/CompressorConsumerMiddleware.cs
similarity index 96%
rename from src/KafkaFlow.Compressor/CompressorConsumerMiddleware.cs
rename to src/KafkaFlow/Middlewares/Compression/CompressorConsumerMiddleware.cs
index 033babbdc..98cc49d55 100644
--- a/src/KafkaFlow.Compressor/CompressorConsumerMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/Compression/CompressorConsumerMiddleware.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.Compressor
+namespace KafkaFlow.Middlewares.Compression
{
using System;
using System.Threading.Tasks;
diff --git a/src/KafkaFlow.Compressor/CompressorProducerMiddleware.cs b/src/KafkaFlow/Middlewares/Compression/CompressorProducerMiddleware.cs
similarity index 96%
rename from src/KafkaFlow.Compressor/CompressorProducerMiddleware.cs
rename to src/KafkaFlow/Middlewares/Compression/CompressorProducerMiddleware.cs
index 89fa47d78..3d82e755e 100644
--- a/src/KafkaFlow.Compressor/CompressorProducerMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/Compression/CompressorProducerMiddleware.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.Compressor
+namespace KafkaFlow.Middlewares.Compression
{
using System;
using System.Threading.Tasks;
diff --git a/src/KafkaFlow.Serializer/ConsumerMiddlewareConfigurationBuilderExtensions.cs b/src/KafkaFlow/Middlewares/Serializer/Configuration/ConsumerMiddlewareConfigurationBuilder.cs
similarity index 97%
rename from src/KafkaFlow.Serializer/ConsumerMiddlewareConfigurationBuilderExtensions.cs
rename to src/KafkaFlow/Middlewares/Serializer/Configuration/ConsumerMiddlewareConfigurationBuilder.cs
index dc80a5ead..05eb1c524 100644
--- a/src/KafkaFlow.Serializer/ConsumerMiddlewareConfigurationBuilderExtensions.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Configuration/ConsumerMiddlewareConfigurationBuilder.cs
@@ -1,12 +1,13 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Configuration
{
using System;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
///
/// No needed
///
- public static class ConsumerMiddlewareConfigurationBuilderExtensions
+ public static class ConsumerMiddlewareConfigurationBuilder
{
///
/// Registers a middleware to deserialize messages
diff --git a/src/KafkaFlow.Serializer/ProducerMiddlewareConfigurationBuilder.cs b/src/KafkaFlow/Middlewares/Serializer/Configuration/ProducerMiddlewareConfigurationBuilder.cs
similarity index 98%
rename from src/KafkaFlow.Serializer/ProducerMiddlewareConfigurationBuilder.cs
rename to src/KafkaFlow/Middlewares/Serializer/Configuration/ProducerMiddlewareConfigurationBuilder.cs
index 4c05e5ae1..e8b9f8f32 100644
--- a/src/KafkaFlow.Serializer/ProducerMiddlewareConfigurationBuilder.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Configuration/ProducerMiddlewareConfigurationBuilder.cs
@@ -1,7 +1,8 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Configuration
{
using System;
using KafkaFlow.Configuration;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
///
/// No needed
diff --git a/src/KafkaFlow.Serializer/AsyncMessageTypeResolverWrapper.cs b/src/KafkaFlow/Middlewares/Serializer/Resolvers/AsyncMessageTypeResolverWrapper.cs
similarity index 91%
rename from src/KafkaFlow.Serializer/AsyncMessageTypeResolverWrapper.cs
rename to src/KafkaFlow/Middlewares/Serializer/Resolvers/AsyncMessageTypeResolverWrapper.cs
index fac02e462..78023bdbd 100644
--- a/src/KafkaFlow.Serializer/AsyncMessageTypeResolverWrapper.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Resolvers/AsyncMessageTypeResolverWrapper.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Resolvers
{
using System;
using System.Threading.Tasks;
diff --git a/src/KafkaFlow.Serializer/DefaultTypeResolver.cs b/src/KafkaFlow/Middlewares/Serializer/Resolvers/DefaultTypeResolver.cs
similarity index 93%
rename from src/KafkaFlow.Serializer/DefaultTypeResolver.cs
rename to src/KafkaFlow/Middlewares/Serializer/Resolvers/DefaultTypeResolver.cs
index 31cba1dff..6802f7d3d 100644
--- a/src/KafkaFlow.Serializer/DefaultTypeResolver.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Resolvers/DefaultTypeResolver.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Resolvers
{
using System;
diff --git a/src/KafkaFlow.Serializer/IAsyncMessageTypeResolver.cs b/src/KafkaFlow/Middlewares/Serializer/Resolvers/IAsyncMessageTypeResolver.cs
similarity index 93%
rename from src/KafkaFlow.Serializer/IAsyncMessageTypeResolver.cs
rename to src/KafkaFlow/Middlewares/Serializer/Resolvers/IAsyncMessageTypeResolver.cs
index ffe4626bd..52ee2fa88 100644
--- a/src/KafkaFlow.Serializer/IAsyncMessageTypeResolver.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Resolvers/IAsyncMessageTypeResolver.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Resolvers
{
using System;
using System.Threading.Tasks;
diff --git a/src/KafkaFlow.Serializer/IMessageTypeResolver.cs b/src/KafkaFlow/Middlewares/Serializer/Resolvers/IMessageTypeResolver.cs
similarity index 93%
rename from src/KafkaFlow.Serializer/IMessageTypeResolver.cs
rename to src/KafkaFlow/Middlewares/Serializer/Resolvers/IMessageTypeResolver.cs
index 5d6d87551..77cc3e89e 100644
--- a/src/KafkaFlow.Serializer/IMessageTypeResolver.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Resolvers/IMessageTypeResolver.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Resolvers
{
using System;
diff --git a/src/KafkaFlow.Serializer/SingleMessageTypeResolver.cs b/src/KafkaFlow/Middlewares/Serializer/Resolvers/SingleMessageTypeResolver.cs
similarity index 94%
rename from src/KafkaFlow.Serializer/SingleMessageTypeResolver.cs
rename to src/KafkaFlow/Middlewares/Serializer/Resolvers/SingleMessageTypeResolver.cs
index b1d22d054..59ec131dc 100644
--- a/src/KafkaFlow.Serializer/SingleMessageTypeResolver.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/Resolvers/SingleMessageTypeResolver.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer.Resolvers
{
using System;
diff --git a/src/KafkaFlow.Serializer/SerializerConsumerMiddleware.cs b/src/KafkaFlow/Middlewares/Serializer/SerializerConsumerMiddleware.cs
similarity index 96%
rename from src/KafkaFlow.Serializer/SerializerConsumerMiddleware.cs
rename to src/KafkaFlow/Middlewares/Serializer/SerializerConsumerMiddleware.cs
index e2bc353b1..3bec7a8f4 100644
--- a/src/KafkaFlow.Serializer/SerializerConsumerMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/SerializerConsumerMiddleware.cs
@@ -1,8 +1,9 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer
{
using System;
using System.IO;
using System.Threading.Tasks;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
///
/// Middleware to deserialize messages when consuming
diff --git a/src/KafkaFlow.Serializer/SerializerProducerMiddleware.cs b/src/KafkaFlow/Middlewares/Serializer/SerializerProducerMiddleware.cs
similarity index 96%
rename from src/KafkaFlow.Serializer/SerializerProducerMiddleware.cs
rename to src/KafkaFlow/Middlewares/Serializer/SerializerProducerMiddleware.cs
index b7c0da7c8..1638e18d4 100644
--- a/src/KafkaFlow.Serializer/SerializerProducerMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/Serializer/SerializerProducerMiddleware.cs
@@ -1,6 +1,7 @@
-namespace KafkaFlow
+namespace KafkaFlow.Middlewares.Serializer
{
using System.Threading.Tasks;
+ using KafkaFlow.Middlewares.Serializer.Resolvers;
using Microsoft.IO;
///
diff --git a/src/KafkaFlow.TypedHandler/TypedHandlerConfiguration.cs b/src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfiguration.cs
similarity index 79%
rename from src/KafkaFlow.TypedHandler/TypedHandlerConfiguration.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfiguration.cs
index 2f33874de..22d5407e2 100644
--- a/src/KafkaFlow.TypedHandler/TypedHandlerConfiguration.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfiguration.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler.Configuration
{
using System;
diff --git a/src/KafkaFlow.TypedHandler/TypedHandlerConfigurationBuilder.cs b/src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfigurationBuilder.cs
similarity index 98%
rename from src/KafkaFlow.TypedHandler/TypedHandlerConfigurationBuilder.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfigurationBuilder.cs
index f51775f90..bef175535 100644
--- a/src/KafkaFlow.TypedHandler/TypedHandlerConfigurationBuilder.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/Configuration/TypedHandlerConfigurationBuilder.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler.Configuration
{
using System;
using System.Collections.Generic;
diff --git a/src/KafkaFlow.TypedHandler/HandlerExecutor.cs b/src/KafkaFlow/Middlewares/TypedHandler/HandlerExecutor.cs
similarity index 95%
rename from src/KafkaFlow.TypedHandler/HandlerExecutor.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/HandlerExecutor.cs
index 4a301ff08..0af39ecd0 100644
--- a/src/KafkaFlow.TypedHandler/HandlerExecutor.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/HandlerExecutor.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler
{
using System;
using System.Collections.Concurrent;
diff --git a/src/KafkaFlow.TypedHandler/HandlerTypeMapping.cs b/src/KafkaFlow/Middlewares/TypedHandler/HandlerTypeMapping.cs
similarity index 95%
rename from src/KafkaFlow.TypedHandler/HandlerTypeMapping.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/HandlerTypeMapping.cs
index cc581f753..986ee1c2a 100644
--- a/src/KafkaFlow.TypedHandler/HandlerTypeMapping.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/HandlerTypeMapping.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler
{
using System;
using System.Collections.Generic;
diff --git a/src/KafkaFlow.TypedHandler/IMessageHandler.cs b/src/KafkaFlow/Middlewares/TypedHandler/IMessageHandler.cs
similarity index 94%
rename from src/KafkaFlow.TypedHandler/IMessageHandler.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/IMessageHandler.cs
index 7c7f181f8..0e4200b80 100644
--- a/src/KafkaFlow.TypedHandler/IMessageHandler.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/IMessageHandler.cs
@@ -1,4 +1,4 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler
{
using System.Threading.Tasks;
diff --git a/src/KafkaFlow.TypedHandler/TypedHandlerMiddleware.cs b/src/KafkaFlow/Middlewares/TypedHandler/TypedHandlerMiddleware.cs
similarity index 93%
rename from src/KafkaFlow.TypedHandler/TypedHandlerMiddleware.cs
rename to src/KafkaFlow/Middlewares/TypedHandler/TypedHandlerMiddleware.cs
index 7269228db..37d308491 100644
--- a/src/KafkaFlow.TypedHandler/TypedHandlerMiddleware.cs
+++ b/src/KafkaFlow/Middlewares/TypedHandler/TypedHandlerMiddleware.cs
@@ -1,7 +1,8 @@
-namespace KafkaFlow.TypedHandler
+namespace KafkaFlow.Middlewares.TypedHandler
{
using System.Linq;
using System.Threading.Tasks;
+ using KafkaFlow.Middlewares.TypedHandler.Configuration;
internal class TypedHandlerMiddleware : IMessageMiddleware
{