public class KafkaItemReaderBuilder<K,V>
extends java.lang.Object
KafkaItemReader
.KafkaItemReader
Constructor and Description |
---|
KafkaItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
KafkaItemReader<K,V> |
build() |
KafkaItemReaderBuilder<K,V> |
consumerProperties(java.util.Properties consumerProperties)
Configure the underlying consumer properties.
|
KafkaItemReaderBuilder<K,V> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
KafkaItemReaderBuilder<K,V> |
partitionOffsets(java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> partitionOffsets)
Setter for partition offsets.
|
KafkaItemReaderBuilder<K,V> |
partitions(java.lang.Integer... partitions)
A list of partitions to manually assign to the consumer.
|
KafkaItemReaderBuilder<K,V> |
partitions(java.util.List<java.lang.Integer> partitions)
A list of partitions to manually assign to the consumer.
|
KafkaItemReaderBuilder<K,V> |
pollTimeout(java.time.Duration pollTimeout)
Set the pollTimeout for the poll() operations.
|
KafkaItemReaderBuilder<K,V> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
KafkaItemReaderBuilder<K,V> |
topic(java.lang.String topic)
A topic name to manually assign to the consumer.
|
public KafkaItemReaderBuilder<K,V> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic KafkaItemReaderBuilder<K,V> name(java.lang.String name)
ExecutionContext
.
Required if saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public KafkaItemReaderBuilder<K,V> consumerProperties(java.util.Properties consumerProperties)
consumerProperties
must contain the following keys:
'bootstrap.servers', 'group.id', 'key.deserializer' and 'value.deserializer'
consumerProperties
- properties of the consumerpublic KafkaItemReaderBuilder<K,V> partitions(java.lang.Integer... partitions)
partitions
- list of partitions to assign to the consumerpublic KafkaItemReaderBuilder<K,V> partitions(java.util.List<java.lang.Integer> partitions)
partitions
- list of partitions to assign to the consumerpublic KafkaItemReaderBuilder<K,V> partitionOffsets(java.util.Map<org.apache.kafka.common.TopicPartition,java.lang.Long> partitionOffsets)
In case of a restart, offsets stored in the execution context will take precedence.
partitionOffsets
- mapping of starting offset in each partitionpublic KafkaItemReaderBuilder<K,V> topic(java.lang.String topic)
topic
- name to assign to the consumerpublic KafkaItemReaderBuilder<K,V> pollTimeout(java.time.Duration pollTimeout)
pollTimeout
- timeout for the poll operationKafkaItemReader.setPollTimeout(Duration)
public KafkaItemReader<K,V> build()