Skip to content

TopicConfigBuilder does not produce the expected configuration for a compacted topic #179

@masesdevelopers

Description

@masesdevelopers

Describe the bug
Trying to create a topic with the following parameters:

  • cleanup.policy=compact,delete
  • delete.retention.ms=100
  • segment.ms=100
  • min.cleanable.dirty.ratio=0.01

fails with an exception.

To Reproduce
Steps to reproduce the behavior:

  1. Execute the following snippet:
var topic = new NewTopic(topicName, partitions, replicationFactor);
topic = topic.Configs(TopicConfigBuilder.Create().WithCleanupPolicy(TopicConfig.CleanupPolicy.Compact | TopicConfig.CleanupPolicy.Delete)
                                                                 .WithDeleteRetentionMs(100)
                                                                 .WithMinCleanableDirtyRatio(0.01)
                                                                 .WithSegmentMs(100));
  1. and use the result to create the topic like in:
                Properties props = AdminClientConfigBuilder.Create().WithBootstrapServers(serverToUse).ToProperties();
                using (IAdmin admin = KafkaAdminClient.Create(props))
                {
                    // Create a compacted topic
                    CreateTopicsResult result = admin.CreateTopics(coll);
                }
  1. See errors: MinCleanableDirtyRatio expect a double, CleanupPolicy is not recognized.

Expected behavior
The topic shall be created with the expected parameters.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: latest

Additional context
N/A

Metadata

Metadata

Labels

KNetKNet related issuebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions