public class KafkaProducerClient extends Object
| Constructor and Description |
|---|
KafkaProducerClient() |
| Modifier and Type | Method and Description |
|---|---|
static <T,TT> org.apache.kafka.clients.producer.Producer<T,TT> |
createProducer(String resource)
Create producer producer.
|
static <T,TT> void |
sendMessage(String resource,
String topic,
T key,
TT msg,
Integer partition,
List<org.apache.kafka.common.header.Header> headers)
Send message.
|
public static <T,TT> org.apache.kafka.clients.producer.Producer<T,TT> createProducer(String resource)
T - the type parameterTT - the type parameterresource - the resourcepublic static <T,TT> void sendMessage(String resource, String topic, T key, TT msg, Integer partition, List<org.apache.kafka.common.header.Header> headers)
T - the type parameterTT - the type parameterresource - the resourcetopic - the topickey - the keymsg - the msgpartition - the partitionCopyright © 2021. All rights reserved.