Skip to content

Commit

Permalink
PoC: Remove older implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
simaoribeiro committed Sep 20, 2023
1 parent 96f87d4 commit 283288b
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,5 @@ IClusterConfigurationBuilder CreateTopicIfNotExists(
string topicName,
int numberOfPartitions,
short replicationFactor);

// Gets the cluster configuration
IClusterConfigurationBuilder AddInstrumentation<TConsumerInstrumentationMiddleware, TProducerInstrumentationMiddleware>()
where TConsumerInstrumentationMiddleware : class, IConsumerInstrumentationMiddleware
where TProducerInstrumentationMiddleware : class, IProducerInstrumentationMiddleware;
}
}

This file was deleted.

1 change: 1 addition & 0 deletions src/KafkaFlow.Abstractions/IConsumerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public interface IConsumerContext
/// </summary>
void Resume();

// TODO: Need to discuss
IReadOnlyCollection<string> Brokers { get; }
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
<ProjectReference Include="..\KafkaFlow.Admin\KafkaFlow.Admin.csproj" />
<ProjectReference Include="..\KafkaFlow\KafkaFlow.csproj" />
</ItemGroup>

</Project>
12 changes: 0 additions & 12 deletions src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json

This file was deleted.

14 changes: 0 additions & 14 deletions src/KafkaFlow/Configuration/ClusterConfigurationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ public IClusterConfigurationBuilder AddConsumer(Action<IConsumerConfigurationBui
return this;
}

public IClusterConfigurationBuilder AddInstrumentation<TConsumerInstrumentationMiddleware, TProducerInstrumentationMiddleware>()
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<IDependencyResolver> handler)
{
this.onStoppingHandler = handler;
Expand Down
6 changes: 0 additions & 6 deletions src/KafkaFlow/Configuration/ConsumerConfigurationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@ public IConsumerConfigurationBuilder WithCustomFactory(ConsumerCustomFactory cus
return this;
}

public void AddInstrumentation<T>(IConsumerInstrumentationMiddleware consumerInstrumentationMiddleware)
where T : class, IMessageMiddleware
{
var type = typeof(IConsumerInstrumentationMiddleware);
}

public IConsumerConfiguration Build(ClusterConfiguration clusterConfiguration)
{
var middlewareConfiguration = this.middlewareConfigurationBuilder.Build();
Expand Down
20 changes: 0 additions & 20 deletions src/KafkaFlow/Configuration/MiddlewareConfigurationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public TBuilder AddAtBeginning<T>(MiddlewareLifetime lifetime = MiddlewareLifeti
return this.AddAt<T>(0, lifetime);
}

public TBuilder AddAtBeginning(Type messageMiddleware, MiddlewareLifetime lifetime = MiddlewareLifetime.ConsumerOrProducer)
{
return this.AddAt(messageMiddleware, 0, lifetime);
}

public IReadOnlyList<MiddlewareConfiguration> Build() => this.middlewaresConfigurations;

private static InstanceLifetime ParseLifetime(MiddlewareLifetime lifetime)
Expand Down Expand Up @@ -97,20 +92,5 @@ private TBuilder AddAt<T>(

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;
}
}
}
1 change: 1 addition & 0 deletions src/KafkaFlow/Consumers/ConsumerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public ConsumerContext(

public string GroupId => this.consumer.Configuration.GroupId;

// TODO: Need to discuss
public IReadOnlyCollection<string> Brokers => this.consumer.Configuration.ClusterConfiguration.Brokers;

public bool ShouldStoreOffset { get; set; } = true;
Expand Down

0 comments on commit 283288b

Please sign in to comment.