use of com.tvd12.ezymq.kafka.EzyKafkaProducer in project ezyfox-examples by tvd12.
the class KafkaProducer method main.
public static void main(String[] args) {
EzyKafkaProxy kafkaProxy = EzyKafkaProxy.builder().build();
EzyKafkaProducer producer = kafkaProxy.getProducer("hello-world");
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
executorService.scheduleAtFixedRate(() -> {
producer.send("hello", "Hello World");
}, 1, 3, TimeUnit.SECONDS);
}
Aggregations