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

com.github.hekonsek.vertx.pipes.internal.KafkaProducerBuilder Maven / Gradle / Ivy

There is a newer version: 0.4
Show newest version
package com.github.hekonsek.vertx.pipes.internal;

import com.google.common.collect.ImmutableMap;
import io.vertx.core.Vertx;
import io.vertx.kafka.client.producer.KafkaProducer;
import org.apache.kafka.common.serialization.BytesSerializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.kafka.common.utils.Bytes;

import java.util.Map;

public class KafkaProducerBuilder {

    public static KafkaProducer pipeProducer(Vertx vertx) {
        Map config = ImmutableMap.of(
                "bootstrap.servers", "localhost:9092",
                "value.serializer", BytesSerializer.class.getName(),
                "key.serializer", StringSerializer.class.getName());
        return KafkaProducer.create(vertx, config);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy