All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.awilton.junit.kafka.samples.SampleApp Maven / Gradle / Ivy

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