Skip to content

Commit

Permalink
Upgrade Kafka Clients to 3.1.0
Browse files Browse the repository at this point in the history
Fix deprecations.
  • Loading branch information
garyrussell authored and artembilan committed Jan 24, 2022
1 parent a63ad4c commit 7ddbf12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ext {
jaywayJsonPathVersion = '2.6.0'
junit4Version = '4.13.2'
junitJupiterVersion = '5.8.2'
kafkaVersion = '3.0.0'
kafkaVersion = '3.1.0'
log4jVersion = '2.17.1'
micrometerVersion = '2.0.0-M1'
mockitoVersion = '4.0.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 the original author or authors.
* Copyright 2017-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -209,7 +209,7 @@ public Map<String, TopicDescription> describeTopics(String... topicNames) {
Map<String, TopicDescription> results = new HashMap<>();
DescribeTopicsResult topics = admin.describeTopics(Arrays.asList(topicNames));
try {
results.putAll(topics.all().get(this.operationTimeout, TimeUnit.SECONDS));
results.putAll(topics.allTopicNames().get(this.operationTimeout, TimeUnit.SECONDS));
return results;
}
catch (InterruptedException ie) {
Expand Down Expand Up @@ -251,7 +251,7 @@ private Map<String, NewPartitions> checkPartitions(Map<String, NewTopic> topicNa
DescribeTopicsResult topicInfo, List<NewTopic> topicsToAdd) {

Map<String, NewPartitions> topicsToModify = new HashMap<>();
topicInfo.values().forEach((n, f) -> {
topicInfo.topicNameValues().forEach((n, f) -> {
NewTopic topic = topicNameToTopic.get(n);
try {
TopicDescription topicDescription = f.get(this.operationTimeout, TimeUnit.SECONDS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -449,7 +449,7 @@ protected void checkTopics() {
.toArray(String[]::new);
}
DescribeTopicsResult result = client.describeTopics(Arrays.asList(topics));
missing = result.values()
missing = result.topicNameValues()
.entrySet()
.stream()
.filter(entry -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 the original author or authors.
* Copyright 2017-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -131,7 +131,7 @@ public void testDefaultPartsAndReplicas() throws Exception {
await().until(() -> {
DescribeTopicsResult topics = adminClient.describeTopics(Arrays.asList("optBoth", "optPart", "optRepl"));
try {
results.putAll(topics.all().get(10, TimeUnit.SECONDS));
results.putAll(topics.allTopicNames().get(10, TimeUnit.SECONDS));
return true;
}
catch (InterruptedException ie) {
Expand Down

0 comments on commit 7ddbf12

Please sign in to comment.