K
- key type.V
- value type.public static final class AsyncFetcher.Builder<K,V> extends Object
Modifier and Type | Method and Description |
---|---|
Fetcher |
build()
Builds the fetcher
|
AsyncFetcher.Builder<K,V> |
onRecordPublished(BiFunction<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>,KafkaTrackingToken,Void> callback)
|
AsyncFetcher.Builder<K,V> |
withBufferFactory(Supplier<Buffer<KafkaEventMessage>> bufferFactory)
Configure the factory for creating buffer that is used for each connection.
|
AsyncFetcher.Builder<K,V> |
withMessageConverter(KafkaMessageConverter<K,V> converter)
Configure the converter which converts Kafka messages to Axon messages.
|
AsyncFetcher.Builder<K,V> |
withPollTimeout(long timeout,
TimeUnit unit)
Configure
ExecutorService that uses Consumer for fetching Kafka records. |
AsyncFetcher.Builder<K,V> |
withPool(ExecutorService sevice)
Configure
ExecutorService that uses Consumer for fetching Kafka records. |
AsyncFetcher.Builder<K,V> |
withTopic(String topic)
Configure Kafka topic to read events from.
|
public AsyncFetcher.Builder<K,V> withPool(ExecutorService sevice)
ExecutorService
that uses Consumer
for fetching Kafka records. Note that the pool
should contain sufficient threads to run the necessary fetcher processes concurrently.
Note that the provided pool will not be shut down when the fetcher is terminated.
sevice
- ExecutorService.public AsyncFetcher.Builder<K,V> onRecordPublished(BiFunction<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>,KafkaTrackingToken,Void> callback)
callback
- function type.public AsyncFetcher.Builder<K,V> withPollTimeout(long timeout, TimeUnit unit)
ExecutorService
that uses Consumer
for fetching Kafka records.timeout
- the timeout when reading message from the topic.unit
- the unit in which the timeout is expressed.public AsyncFetcher.Builder<K,V> withMessageConverter(KafkaMessageConverter<K,V> converter)
converter
- the converter.public AsyncFetcher.Builder<K,V> withTopic(String topic)
topic
- the topic.public AsyncFetcher.Builder<K,V> withBufferFactory(Supplier<Buffer<KafkaEventMessage>> bufferFactory)
bufferFactory
- the bufferFactory.public Fetcher build()
Copyright © 2010–2018. All rights reserved.