-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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?
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.
Have your tried running it?
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.
Yes, I did run it locally -- not sure what your question is?
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.
It does log Starting a Kafka instance on port null ...
(what make sense given that we did remove the config...)
I don't know how I could get the port though... maybe best to just remove the DEBUG line all together? Seems not to add much value?
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.
yeah, this is just confusing. remove the log
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
@@ -155,7 +155,7 @@ after_pipeline: | |||
- name: SonarQube | |||
commands: | |||
- checkout | |||
- sem-version java 11 | |||
- if [[ $SEMAPHORE_GIT_BRANCH =~ ^7\..* ]]; then sem-version java 8; else sem-version java 17; fi |
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.
why change from 11 to 8? 11 is the recommended version for CP.
should we cover 6.x releases as well in case of (out of support window) backports?
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.
For 7.x, we still support Java 8. -- I don't think it's about recommended, but supported?
It's more a question for @hk10111 thouhg. Cf #527
I would have hard-coded Java 8 for older branches and hard-coded Java 17 for 8.0+, but they want to have the same semaphore.yml
config across all branches -- that's why the if-else.
Guess we could also use Java 11 for older branches, but historically we use Java 8.
Anyway, the other commit finally made it into all branches I believe, so this change will go away for this PR anyway.
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.
I left some comments, but mostly looking good to me
Build is broken due to broken upstream dependency. Need to wait for an upstream fix... |
No description provided.