public class KafkaProducer
extends org.apache.camel.support.DefaultAsyncProducer
Constructor and Description |
---|
KafkaProducer(KafkaEndpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.camel.util.KeyValueHolder<Object,org.apache.kafka.clients.producer.ProducerRecord<Object,Object>> |
createKeyValueHolder(org.apache.camel.Exchange exchange,
org.apache.camel.Message message) |
protected org.apache.kafka.clients.producer.ProducerRecord<Object,Object> |
createRecord(org.apache.camel.Exchange exchange,
org.apache.camel.Message message) |
protected Iterator<org.apache.camel.util.KeyValueHolder<Object,org.apache.kafka.clients.producer.ProducerRecord<Object,Object>>> |
createRecordIterable(org.apache.camel.Exchange exchange,
org.apache.camel.Message message) |
protected void |
doStart() |
protected void |
doStop() |
org.apache.kafka.clients.producer.Producer |
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.Producer kafkaProducer)
To use a custom
KafkaProducer instance. |
void |
setWorkerPool(ExecutorService workerPool) |
createExchange, getEndpoint, isSingleton, toString
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public KafkaProducer(KafkaEndpoint endpoint)
public org.apache.kafka.clients.producer.Producer getKafkaProducer()
public void setKafkaProducer(org.apache.kafka.clients.producer.Producer kafkaProducer)
KafkaProducer
instance.public ExecutorService getWorkerPool()
public void setWorkerPool(ExecutorService workerPool)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.DefaultProducer
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.DefaultProducer
Exception
protected Iterator<org.apache.camel.util.KeyValueHolder<Object,org.apache.kafka.clients.producer.ProducerRecord<Object,Object>>> createRecordIterable(org.apache.camel.Exchange exchange, org.apache.camel.Message message)
protected org.apache.kafka.clients.producer.ProducerRecord<Object,Object> createRecord(org.apache.camel.Exchange exchange, org.apache.camel.Message message)
protected org.apache.camel.util.KeyValueHolder<Object,org.apache.kafka.clients.producer.ProducerRecord<Object,Object>> createKeyValueHolder(org.apache.camel.Exchange exchange, org.apache.camel.Message message)
public void process(org.apache.camel.Exchange exchange) throws Exception
process
in interface org.apache.camel.Processor
process
in class org.apache.camel.support.DefaultAsyncProducer
Exception
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
Apache Camel