@Experimental(value="experimental api")
public interface KafkaClientService
Modifier and Type | Method and Description |
---|---|
<K,V> KafkaConsumer<K,V> |
getConsumer(String channel)
Gets the managed Kafka Consumer for the given channel.
|
<K,V> org.apache.kafka.clients.producer.Producer<K,V> |
getProducer(String channel)
Gets the managed Kafka Producer for the given channel.
|
<K,V> KafkaConsumer<K,V> getConsumer(String channel)
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.
K
- the type of the keyV
- the type of the valuechannel
- the channel, must not be null
null
if not found<K,V> org.apache.kafka.clients.producer.Producer<K,V> getProducer(String channel)
K
- the type of the keyV
- the type of the valuechannel
- the channel, must not be null
null
if not foundCopyright © 2018–2021 SmallRye. All rights reserved.