Class RedisItemWriter<K,T>
java.lang.Object
org.springframework.batch.item.KeyValueItemWriter<K,T>
org.springframework.batch.item.redis.RedisItemWriter<K,T>
- All Implemented Interfaces:
ItemWriter<T>
,org.springframework.beans.factory.InitializingBean
An ItemWriter
implementation for Redis using a RedisTemplate
.
- Since:
- 5.1
- Author:
- Santiago Molano, Mahmoud Ben Hassine
-
Field Summary
Fields inherited from class org.springframework.batch.item.KeyValueItemWriter
delete, itemKeyMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
init()
afterPropertiesSet() hookvoid
setRedisTemplate
(org.springframework.data.redis.core.RedisTemplate<K, T> redisTemplate) Set theRedisTemplate
to use.protected void
writeKeyValue
(K key, T value) Subclasses implement this method to write each item to key value storeMethods inherited from class org.springframework.batch.item.KeyValueItemWriter
afterPropertiesSet, flush, setDelete, setItemKeyMapper, write
-
Constructor Details
-
RedisItemWriter
public RedisItemWriter()
-
-
Method Details
-
writeKeyValue
Description copied from class:KeyValueItemWriter
Subclasses implement this method to write each item to key value store- Specified by:
writeKeyValue
in classKeyValueItemWriter<K,
T> - Parameters:
key
- the keyvalue
- the item
-
init
protected void init()Description copied from class:KeyValueItemWriter
afterPropertiesSet() hook- Specified by:
init
in classKeyValueItemWriter<K,
T>
-
setRedisTemplate
Set theRedisTemplate
to use.- Parameters:
redisTemplate
- the template to use
-