diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db0d36..31026ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.28.2] - 2024-01-25 + +### Fixed + +- Error message "Topics for default shard have to be specified on 'tw-tkms.topics' property." given, when default shard was not defining any topics. + ## [0.28.1] - 2024-01-12 ### Fixed diff --git a/gradle.properties b/gradle.properties index 1f3888a..d45e274 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.28.1 +version=0.28.2 diff --git a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/TkmsTopicValidator.java b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/TkmsTopicValidator.java index 5f9bde9..aa7eb43 100644 --- a/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/TkmsTopicValidator.java +++ b/tw-tkms-starter/src/main/java/com/transferwise/kafka/tkms/TkmsTopicValidator.java @@ -92,7 +92,7 @@ public void preValidateAll() { var shardProperties = tkmsProperties.getShards().get(shard); List shardTopics = shardProperties == null ? null : shardProperties.getTopics(); - if (shardTopics != null && shard == tkmsProperties.getDefaultShard()) { + if (shardTopics != null && !shardTopics.isEmpty() && shard == tkmsProperties.getDefaultShard()) { throw new IllegalStateException("Topics for default shard have to be specified on 'tw-tkms.topics' property."); } diff --git a/tw-tkms-starter/src/test/resources/application.yml b/tw-tkms-starter/src/test/resources/application.yml index 69cc451..616ffa5 100644 --- a/tw-tkms-starter/src/test/resources/application.yml +++ b/tw-tkms-starter/src/test/resources/application.yml @@ -36,6 +36,9 @@ tw-tkms: kafka: bootstrap.servers: "${TW_TKMS_KAFKA_1_TCP_HOST:localhost}:${TW_TKMS_KAFKA_1_TCP_9092}" shards: + # Covers a bug with topics validation + 0: + polling-interval: 6ms 1: polling-interval: 6ms kafka: