Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dangling tasks fix 2 #396

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions core/StreamConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ public StreamConfig()
/// </para>
/// </summary>
/// <param name="properties">Dictionary of stream properties</param>
public StreamConfig(IDictionary<string, dynamic> properties)
public StreamConfig(IDictionary<string, dynamic> properties, ILoggerFactory loggerFactory = null)
{
InitializeReflectedProperties();

Expand Down Expand Up @@ -2329,17 +2329,22 @@ public StreamConfig(IDictionary<string, dynamic> properties)
PartitionAssignmentStrategy = Confluent.Kafka.PartitionAssignmentStrategy.Range;
Partitioner = Confluent.Kafka.Partitioner.Murmur2Random;

Logger = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Information);
builder.AddConsole();
});

Logger = loggerFactory;

if (properties != null)
{
foreach (var k in properties)
AddConfig(k.Key, k.Value);
}

if (Logger != null)
return;

Logger = LoggerFactory.Create(builder =>
{
builder.SetMinimumLevel(LogLevel.Information);
builder.AddConsole();
});
}

#endregion
Expand Down Expand Up @@ -3403,8 +3408,9 @@ public StreamConfig() : this(null) { }
/// </para>
/// </summary>
/// <param name="properties">Dictionary of stream properties</param>
public StreamConfig(IDictionary<string, dynamic> properties)
: base(properties)
/// <param name="loggerFactory">LoggerFactory for creating loggers. If not provided new instance will be created</param>
public StreamConfig(IDictionary<string, dynamic> properties, ILoggerFactory loggerFactory = null)
: base(properties, loggerFactory)
{
DefaultKeySerDes = new KS();
DefaultValueSerDes = new VS();
Expand Down
Loading