public class KafkaProducer
extends org.apache.camel.support.DefaultAsyncProducer
| Constructor and Description |
|---|
KafkaProducer(KafkaEndpoint endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected Iterator<org.apache.kafka.clients.producer.ProducerRecord> |
createRecorder(org.apache.camel.Exchange exchange) |
protected void |
doStart() |
protected void |
doStop() |
org.apache.kafka.clients.producer.KafkaProducer |
getKafkaProducer() |
ExecutorService |
getWorkerPool() |
void |
process(org.apache.camel.Exchange exchange) |
boolean |
process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback) |
void |
setKafkaProducer(org.apache.kafka.clients.producer.KafkaProducer kafkaProducer)
To use a custom
KafkaProducer instance. |
void |
setWorkerPool(ExecutorService workerPool) |
protected Object |
tryConvertToSerializedType(org.apache.camel.Exchange exchange,
Object object,
String serializerClass)
Attempts to convert the object to the same type as the serialized class specified
|
createExchange, getEndpoint, isSingleton, toStringbuild, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic KafkaProducer(KafkaEndpoint endpoint)
public org.apache.kafka.clients.producer.KafkaProducer getKafkaProducer()
public void setKafkaProducer(org.apache.kafka.clients.producer.KafkaProducer kafkaProducer)
KafkaProducer instance.public ExecutorService getWorkerPool()
public void setWorkerPool(ExecutorService workerPool)
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.DefaultProducerExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.DefaultProducerExceptionprotected Iterator<org.apache.kafka.clients.producer.ProducerRecord> createRecorder(org.apache.camel.Exchange exchange) throws Exception
Exceptionpublic void process(org.apache.camel.Exchange exchange)
throws Exception
process in interface org.apache.camel.Processorprocess in class org.apache.camel.support.DefaultAsyncProducerExceptionpublic boolean process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback)
Apache Camel