-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MINOR: remove ZK from code base #529
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -241,6 +238,12 @@ | |||
<classifier>test</classifier> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.kafka</groupId> | |||
<artifactId>kafka-test-common</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To pull in KafkaClusterTestKit
.
<groupId>jakarta.xml.bind</groupId> | ||
<artifactId>jakarta.xml.bind-api</artifactId> | ||
<version>4.0.1</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W/o this, I got some ClassNotFoundException
error -- just Googled for the error and found to add this... 🤷
producer.send(new ProducerRecord<>(WikipediaFeedAvroExample.WIKIPEDIA_FEED, | ||
new WikiFeed("john", true, "first post"))); | ||
producer.flush(); | ||
try (final KafkaProducer<String, WikiFeed> producer = new KafkaProducer<>(props)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side cleanup to close the producer properly.
final Map<String, String> effectiveBrokerConfig = effectiveBrokerConfigFrom(brokerConfig); | ||
log.debug( | ||
"Starting a Kafka instance on port {} ...", | ||
effectiveBrokerConfig.get(SocketServerConfigs.LISTENERS_CONFIG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we don't configure this explicitly any longer, I am not 100% if this is still right?
effectiveConfig.putAll(brokerConfig); | ||
effectiveConfig.put(ZkConfigs.ZK_CONNECT_CONFIG, zookeeper.connectString()); | ||
effectiveConfig.put(ZkConfigs.ZK_SESSION_TIMEOUT_MS_CONFIG, 30 * 1000); | ||
effectiveConfig.put(SocketServerConfigs.LISTENERS_CONFIG, String.format("PLAINTEXT://127.0.0.1:%s", DEFAULT_BROKER_PORT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to remove this -- otherwise, I got some config errors about other missing config... not sure why this was set to begin with? Did not want to go down the rabbit whole figuring out all other required/dependent configs to keep it (also not sure why it did work with the old setup, but not the new one... 🤷)
} catch (final Exception fatal) { | ||
throw new RuntimeException(fatal); | ||
if (schemaRegistry != null) { | ||
schemaRegistry.stop(); | ||
} | ||
if (broker != null) { | ||
broker.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this throws now, so changed the try-catch to also handle it.
@@ -267,16 +253,14 @@ private TopicsDeletedCondition(final String... topics) { | |||
|
|||
@Override | |||
public boolean conditionMet() { | |||
//TODO once KAFKA-6098 is fixed use AdminClient to verify topics have been deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not fixed yet... but was simplest to just use Admin
client now...
private Properties effectiveConfigFrom(final Properties initialConfig) { | ||
final Properties effectiveConfig = new Properties(); | ||
effectiveConfig.put(ServerConfigs.BROKER_ID_CONFIG, 0); | ||
effectiveConfig.put(SocketServerConfigs.LISTENERS_CONFIG, "PLAINTEXT://127.0.0.1:9092"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above. Removed this one.
.semaphore/semaphore.yml
Outdated
@@ -24,7 +24,7 @@ global_job_config: | |||
prologue: | |||
commands: | |||
- checkout | |||
- sem-version java 11 | |||
- sem-version java 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2338aa8
to
241652b
Compare
8c2b34b
to
d79f036
Compare
No description provided.