Interface KafkaClientService
- All Known Implementing Classes:
KafkaClientServiceImpl
@Experimental("experimental api")
public interface KafkaClientService
-
Method Summary
Modifier and TypeMethodDescriptiondefault <K,V> KafkaConsumer<K, V> getConsumer(String channel) Gets the managed Kafka Consumer for the given channel.Get the names of all the Kafka incoming channels managed by this connector.<K,V> List<KafkaConsumer<K, V>> getConsumers(String channel) Gets the list of managed Kafka Consumer for the given channel.<K,V> KafkaProducer<K, V> getProducer(String channel) Gets the managed Kafka Producer for the given channel.Get the names of all the Kafka outgoing channels managed by this connector.
-
Method Details
-
getConsumer
Gets the managed Kafka Consumer for the given channel. This method returns the reactive consumer.Be aware that most actions requires to be run on the Kafka polling thread. You can schedule actions using:
getConsumer(channel).runOnPollingThread(c -> { ... })You can retrieve the low-level client using the
KafkaConsumer.unwrap()method.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
channel- the channel, must not benull- Returns:
- the consumer,
nullif not found
-
getConsumers
Gets the list of managed Kafka Consumer for the given channel. This method returns a reactive consumers, in the order of creation for multi-consumer channels.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
channel- the channel, must not benull- Returns:
- the list of consumers, empty list if not found
-
getProducer
Gets the managed Kafka Producer for the given channel. This method returns the reactive producer.Be aware that most actions require to be run on the Kafka sending thread. You can schedule actions using:
getProducer(channel).runOnSendingThread(c -> { ... })You can retrieve the low-level client using the
KafkaProducer.unwrap()method.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
channel- the channel, must not benull- Returns:
- the producer,
nullif not found
-
getConsumerChannels
Get the names of all the Kafka incoming channels managed by this connector.- Returns:
- the names of the Kafka consumer incoming channels.
-
getProducerChannels
Get the names of all the Kafka outgoing channels managed by this connector.- Returns:
- the names of the Kafka producer outgoing channels.
-