Class KafkaTopicClient
- java.lang.Object
-
- io.quarkus.kafka.client.runtime.ui.KafkaTopicClient
-
@ApplicationScoped public class KafkaTopicClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) KafkaAdminClient
adminClient
(package private) Map<String,Object>
config
(package private) KafkaModelConverter
modelConverter
-
Constructor Summary
Constructors Constructor Description KafkaTopicClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createMessage(KafkaMessageCreateRequest request)
Map<Integer,Long>
getPagePartitionOffset(String topicName, Collection<Integer> requestedPartitions, Order order)
KafkaMessagePage
getTopicMessages(String topicName, Order order, Map<Integer,Long> partitionOffsets, int pageSize)
Reads the messages from particular topic.List<Integer>
partitions(String topicName)
-
-
-
Field Detail
-
adminClient
@Inject KafkaAdminClient adminClient
-
modelConverter
KafkaModelConverter modelConverter
-
-
Method Detail
-
getTopicMessages
public KafkaMessagePage getTopicMessages(String topicName, Order order, Map<Integer,Long> partitionOffsets, int pageSize) throws ExecutionException, InterruptedException
Reads the messages from particular topic. Offset for next page is returned within response. The first/last page offset could be retrieved withgetPagePartitionOffset(String, Collection, Order)
method.- Parameters:
topicName
- topic to read messages fromorder
- ascending or descending. Defaults to descending (newest first)partitionOffsets
- the offset for page to be readpageSize
- size of read page- Returns:
- page of messages, matching requested filters
- Throws:
ExecutionException
InterruptedException
-
getPagePartitionOffset
public Map<Integer,Long> getPagePartitionOffset(String topicName, Collection<Integer> requestedPartitions, Order order) throws ExecutionException, InterruptedException
-
createMessage
public void createMessage(KafkaMessageCreateRequest request)
-
partitions
public List<Integer> partitions(String topicName) throws ExecutionException, InterruptedException
-
-