diff --git a/src/KafkaFlow.Abstractions/Configuration/IClusterConfigurationBuilder.cs b/src/KafkaFlow.Abstractions/Configuration/IClusterConfigurationBuilder.cs index 5026dcc8a..41325ef45 100644 --- a/src/KafkaFlow.Abstractions/Configuration/IClusterConfigurationBuilder.cs +++ b/src/KafkaFlow.Abstractions/Configuration/IClusterConfigurationBuilder.cs @@ -82,10 +82,5 @@ IClusterConfigurationBuilder CreateTopicIfNotExists( string topicName, int numberOfPartitions, short replicationFactor); - - // Gets the cluster configuration - IClusterConfigurationBuilder AddInstrumentation() - where TConsumerInstrumentationMiddleware : class, IConsumerInstrumentationMiddleware - where TProducerInstrumentationMiddleware : class, IProducerInstrumentationMiddleware; } } diff --git a/src/KafkaFlow.Abstractions/Configuration/IInstrumentationBuilder.cs b/src/KafkaFlow.Abstractions/Configuration/IInstrumentationBuilder.cs deleted file mode 100644 index db023a8b1..000000000 --- a/src/KafkaFlow.Abstractions/Configuration/IInstrumentationBuilder.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace KafkaFlow.Configuration -{ - public interface IInstrumentationBuilder - { - void AddInstrumentation(); - } -} diff --git a/src/KafkaFlow.Abstractions/IConsumerContext.cs b/src/KafkaFlow.Abstractions/IConsumerContext.cs index 62b63e432..3348779ed 100644 --- a/src/KafkaFlow.Abstractions/IConsumerContext.cs +++ b/src/KafkaFlow.Abstractions/IConsumerContext.cs @@ -75,6 +75,7 @@ public interface IConsumerContext /// void Resume(); + // TODO: Need to discuss IReadOnlyCollection Brokers { get; } } } diff --git a/src/KafkaFlow.Abstractions/IConsumerInstrumentationMiddleware.cs b/src/KafkaFlow.Abstractions/IConsumerInstrumentationMiddleware.cs deleted file mode 100644 index 1ea7cc8bd..000000000 --- a/src/KafkaFlow.Abstractions/IConsumerInstrumentationMiddleware.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace KafkaFlow -{ - public interface IConsumerInstrumentationMiddleware : IMessageMiddleware - { - } -} diff --git a/src/KafkaFlow.Abstractions/IProducerInstrumentationMiddleware.cs b/src/KafkaFlow.Abstractions/IProducerInstrumentationMiddleware.cs deleted file mode 100644 index 9eb162a23..000000000 --- a/src/KafkaFlow.Abstractions/IProducerInstrumentationMiddleware.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace KafkaFlow -{ - public interface IProducerInstrumentationMiddleware : IMessageMiddleware - { - } -} diff --git a/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj b/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj index 6a9338a13..1561f20ef 100644 --- a/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj +++ b/src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj @@ -39,5 +39,5 @@ - + diff --git a/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json b/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json deleted file mode 100644 index 1b8239a87..000000000 --- a/src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "KafkaFlow.Admin.Dashboard": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:57596;http://localhost:57597" - } - } -} \ No newline at end of file diff --git a/src/KafkaFlow/Configuration/ClusterConfigurationBuilder.cs b/src/KafkaFlow/Configuration/ClusterConfigurationBuilder.cs index 2ee0628fa..c297c89f0 100644 --- a/src/KafkaFlow/Configuration/ClusterConfigurationBuilder.cs +++ b/src/KafkaFlow/Configuration/ClusterConfigurationBuilder.cs @@ -98,20 +98,6 @@ public IClusterConfigurationBuilder AddConsumer(Action() - where TConsumerInstrumentationMiddleware : class, IConsumerInstrumentationMiddleware - where TProducerInstrumentationMiddleware : class, IProducerInstrumentationMiddleware - { - this.instrumentationConsumerMiddleware = typeof(TConsumerInstrumentationMiddleware); - this.instrumentationProducerMiddleware = typeof(IProducerInstrumentationMiddleware); - - //this.DependencyConfigurator - // .AddTransient(typeof(IConsumerInstrumentationMiddleware), this.instrumentationConsumerMiddleware) - // .AddTransient(typeof(IProducerInstrumentationMiddleware), this.instrumentationProducerMiddleware); - - return this; - } - public IClusterConfigurationBuilder OnStopping(Action handler) { this.onStoppingHandler = handler; diff --git a/src/KafkaFlow/Configuration/ConsumerConfigurationBuilder.cs b/src/KafkaFlow/Configuration/ConsumerConfigurationBuilder.cs index ca2dc531e..f7e601ed0 100644 --- a/src/KafkaFlow/Configuration/ConsumerConfigurationBuilder.cs +++ b/src/KafkaFlow/Configuration/ConsumerConfigurationBuilder.cs @@ -229,12 +229,6 @@ public IConsumerConfigurationBuilder WithCustomFactory(ConsumerCustomFactory cus return this; } - public void AddInstrumentation(IConsumerInstrumentationMiddleware consumerInstrumentationMiddleware) - where T : class, IMessageMiddleware - { - var type = typeof(IConsumerInstrumentationMiddleware); - } - public IConsumerConfiguration Build(ClusterConfiguration clusterConfiguration) { var middlewareConfiguration = this.middlewareConfigurationBuilder.Build(); diff --git a/src/KafkaFlow/Configuration/MiddlewareConfigurationBuilder.cs b/src/KafkaFlow/Configuration/MiddlewareConfigurationBuilder.cs index 6ce82d57a..642f3641d 100644 --- a/src/KafkaFlow/Configuration/MiddlewareConfigurationBuilder.cs +++ b/src/KafkaFlow/Configuration/MiddlewareConfigurationBuilder.cs @@ -44,11 +44,6 @@ public TBuilder AddAtBeginning(MiddlewareLifetime lifetime = MiddlewareLifeti return this.AddAt(0, lifetime); } - public TBuilder AddAtBeginning(Type messageMiddleware, MiddlewareLifetime lifetime = MiddlewareLifetime.ConsumerOrProducer) - { - return this.AddAt(messageMiddleware, 0, lifetime); - } - public IReadOnlyList Build() => this.middlewaresConfigurations; private static InstanceLifetime ParseLifetime(MiddlewareLifetime lifetime) @@ -97,20 +92,5 @@ private TBuilder AddAt( return this as TBuilder; } - - private TBuilder AddAt( - Type messageMiddleware, - int position, - MiddlewareLifetime lifetime = MiddlewareLifetime.ConsumerOrProducer) - { - - this.DependencyConfigurator.Add(typeof(IMessageMiddleware), messageMiddleware, ParseLifetime(lifetime)); - - this.middlewaresConfigurations.Insert( - position, - new MiddlewareConfiguration(messageMiddleware.GetType(), lifetime)); - - return this as TBuilder; - } } } diff --git a/src/KafkaFlow/Consumers/ConsumerContext.cs b/src/KafkaFlow/Consumers/ConsumerContext.cs index 267647e71..5ccbe5662 100644 --- a/src/KafkaFlow/Consumers/ConsumerContext.cs +++ b/src/KafkaFlow/Consumers/ConsumerContext.cs @@ -39,6 +39,7 @@ public ConsumerContext( public string GroupId => this.consumer.Configuration.GroupId; + // TODO: Need to discuss public IReadOnlyCollection Brokers => this.consumer.Configuration.ClusterConfiguration.Brokers; public bool ShouldStoreOffset { get; set; } = true;