Skip to content

Commit

Permalink
Error message "Topics for default shard have to be specified on 'tw-t…
Browse files Browse the repository at this point in the history
…kms.topics' property." given, when default shard was not defining any topics. (#83)
  • Loading branch information
onukristo authored Jan 26, 2024
1 parent ce078cf commit ae5f5e7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.28.1
version=0.28.2
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void preValidateAll() {
var shardProperties = tkmsProperties.getShards().get(shard);
List<String> 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.");
}

Expand Down
3 changes: 3 additions & 0 deletions tw-tkms-starter/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ae5f5e7

Please sign in to comment.