Skip to content

Commit

Permalink
Merge pull request #10 from lsportsltd/fix/kafka-without-topics
Browse files Browse the repository at this point in the history
fixed curator crashing when there are no existing topics found
  • Loading branch information
nizanrosh authored Aug 27, 2024
2 parents 9c7b6c6 + d5c49b7 commit 8ccfaa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# kafka-curator

# Introduction
- KafkaCurator was designed to provide a simple and suprevised way to manage everything related to Kafka topics.
- Alot of the code in this library was inspired by [KafkaFlow](https://github.com/Farfetch/kafkaflow).
- KafkaCurator was designed to provide a simple and supervised way to manage everything related to Kafka topics.
- A lot of the code in this library was inspired by [KafkaFlow](https://github.com/Farfetch/kafkaflow).

# Getting Started
## Requirements
Expand Down
4 changes: 3 additions & 1 deletion src/KafkaCurator/State/DefaultStateManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -34,6 +35,7 @@ private async Task<IReadOnlyList<ITopicConfiguration>> GetTopicMetadata()
{
var topicsMetadata = _adminClient.GetMetadata(_configuration.Timeout).Topics
.ToDictionary(t => t.Topic, t => t);
if (topicsMetadata.Keys.Count == 0) return new List<ITopicConfiguration>().AsReadOnly();

var topicsConfigResults = await DescribeTopicConfigAsync(topicsMetadata.Keys);

Expand Down

0 comments on commit 8ccfaa8

Please sign in to comment.