Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Created February 28, 2020 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpluta/7d161def3a581b1fb95d83651ab47d18 to your computer and use it in GitHub Desktop.
Save pawelpluta/7d161def3a581b1fb95d83651ab47d18 to your computer and use it in GitHub Desktop.
class KafkaContainerWrapper extends KafkaContainer {
private static KafkaContainerWrapper CONTAINER
private KafkaContainerWrapper(String confluentPlatformVersion) {
super(confluentPlatformVersion)
}
static KafkaContainer getContainer() {
// container creation logic
CONTAINER
}
@Override
protected void containerIsStarted(InspectContainerResponse containerInfo, boolean reused) {
if (!reused) {
createKafkaTopics()
}
}
void createKafkaTopics() {
// invoking commands on container to create Apache Kafka topics
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment