Skip to content

update to kafka v2.2.1 #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ repositories {

dependencies {
compile 'junit:junit:4.11'
compile('org.apache.kafka:kafka_2.11:2.1.0') {
compile('org.apache.kafka:kafka_2.11:2.2.1') {
exclude module: 'slf4j-simple'
exclude module: 'slf4j-log4j12'
exclude module: 'jmxtools'
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/info/batey/kafka/unit/KafkaUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import kafka.server.KafkaServerStartable;
import kafka.zk.KafkaZkClient;
import org.apache.commons.io.FileUtils;
import org.apache.kafka.clients.admin.AdminClient;
import org.apache.kafka.clients.admin.KafkaAdminClient;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
Expand Down Expand Up @@ -196,7 +198,9 @@ public void createTopic(String topicName, int numPartitions) {
try (KafkaZkClient zkUtils = getZkClient(opts)) {
// run
LOGGER.info("Executing: CreateTopic " + Arrays.toString(arguments));
TopicCommand.createTopic(zkUtils, opts);
TopicCommand.ZookeeperTopicService zookeeperTopicService =
new TopicCommand.ZookeeperTopicService(zkUtils);
zookeeperTopicService.createTopic(opts);
}

}
Expand Down Expand Up @@ -227,7 +231,8 @@ public void print(String s) {
}
}
});
TopicCommand.listTopics(client, opts);
TopicCommand.ZookeeperTopicService zkTopicService = new TopicCommand.ZookeeperTopicService(client);
zkTopicService.listTopics(opts);
} finally {
Console.setOut(oldOut);
}
Expand All @@ -236,7 +241,7 @@ public void print(String s) {
}

private KafkaZkClient getZkClient(TopicCommand.TopicCommandOptions opts) {
return KafkaZkClient.apply(opts.options().valueOf(opts.zkConnectOpt()),
return KafkaZkClient.apply(opts.zkConnect().get(),
JaasUtils.isZkSecurityEnabled(),
30000,
30000,
Expand Down Expand Up @@ -275,7 +280,8 @@ public void deleteTopic(String topicName) {
try (KafkaZkClient zkUtils = getZkClient(opts)) {
// run
LOGGER.info("Executing: DeleteTopic " + Arrays.toString(arguments));
TopicCommand.deleteTopic(zkUtils, opts);
TopicCommand.ZookeeperTopicService zkTopicService = new TopicCommand.ZookeeperTopicService(zkUtils);
zkTopicService.deleteTopic(opts);
}
}

Expand Down