Package org.apache.camel.component.kafka
Interface KafkaClientFactory
-
- All Known Implementing Classes:
DefaultKafkaClientFactory
public interface KafkaClientFactoryFactory to create a new KafkaConsumerand KafkaProducerinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetBrokers(KafkaConfiguration configuration)URL of the Kafka brokers to use.org.apache.kafka.clients.consumer.ConsumergetConsumer(Properties kafkaProps)Creates a new instance of the KafkaConsumerclass.org.apache.kafka.clients.producer.ProducergetProducer(Properties kafkaProps)Creates a new instance of the KafkaProducerclass.
-
-
-
Method Detail
-
getProducer
org.apache.kafka.clients.producer.Producer getProducer(Properties kafkaProps)
Creates a new instance of the KafkaProducerclass.- Parameters:
kafkaProps- The producer configs.- Returns:
- an instance of Kafka producer.
-
getConsumer
org.apache.kafka.clients.consumer.Consumer getConsumer(Properties kafkaProps)
Creates a new instance of the KafkaConsumerclass.- Parameters:
kafkaProps- The consumer configs.- Returns:
- an instance of Kafka consumer.
-
getBrokers
String getBrokers(KafkaConfiguration configuration)
URL of the Kafka brokers to use. The format is host1:port1,host2:port2, and the list can be a subset of brokers or a VIP pointing to a subset of brokers. This option is known as bootstrap.servers in the Kafka documentation.- Parameters:
configuration- the configuration
-
-