public class KafkaItemWriter<K,T> extends KeyValueItemWriter<K,T>
An ItemWriter
implementation for Apache Kafka using a
KafkaTemplate
with default topic configured.
Modifier and Type | Field and Description |
---|---|
protected org.springframework.kafka.core.KafkaTemplate<K,T> |
kafkaTemplate |
delete, itemKeyMapper
Constructor and Description |
---|
KafkaItemWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
init()
afterPropertiesSet() hook
|
void |
setKafkaTemplate(org.springframework.kafka.core.KafkaTemplate<K,T> kafkaTemplate)
Set the
KafkaTemplate to use. |
protected void |
writeKeyValue(K key,
T value)
Subclasses implement this method to write each item to key value store
|
afterPropertiesSet, setDelete, setItemKeyMapper, write
protected void writeKeyValue(K key, T value)
KeyValueItemWriter
writeKeyValue
in class KeyValueItemWriter<K,T>
key
- the keyvalue
- the itemprotected void init()
KeyValueItemWriter
init
in class KeyValueItemWriter<K,T>