com.awilton.junit.kafka.samples.SampleApp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kafka-unit Show documentation
Show all versions of kafka-unit Show documentation
JUnit utilities for testing kafka clients
The newest version!
package com.awilton.junit.kafka.samples;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.awilton.junit.kafka.embedded.EmbeddedKafka;
public class SampleApp {
private static final Logger log = LoggerFactory.getLogger(SampleApp.class);
private static final String topic = "TestTopic";
public static void main(String[] args) throws InterruptedException {
EmbeddedKafka kafka = new EmbeddedKafka(5100,5101);
for (int i=0; i<5; i++) {
Thread.sleep(500);
kafka.getProducer().send(topic, "Hello" + i);
}
kafka.shutdown();
System.exit(0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy