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

public class RedisItemWriter<K,T> extends KeyValueItemWriter<K,T>

An ItemWriter implementation for Redis using a RedisTemplate .

Since:
5.1
Author:
Santiago Molano, Mahmoud Ben Hassine
  • Constructor Details

    • RedisItemWriter

      public RedisItemWriter()
  • Method Details

    • writeKeyValue

      protected void writeKeyValue(K key, T value)
      Description copied from class: KeyValueItemWriter
      Subclasses implement this method to write each item to key value store
      Specified by:
      writeKeyValue in class KeyValueItemWriter<K,T>
      Parameters:
      key - the key
      value - the item
    • init

      protected void init()
      Description copied from class: KeyValueItemWriter
      afterPropertiesSet() hook
      Specified by:
      init in class KeyValueItemWriter<K,T>
    • setRedisTemplate

      public void setRedisTemplate(org.springframework.data.redis.core.RedisTemplate<K,T> redisTemplate)
      Set the RedisTemplate to use.
      Parameters:
      redisTemplate - the template to use