0

I am able to store my message using the following command and spring seems to be setting the Key:

org.springframework.data.redis.core.RedisTemplate.boundListOps("myid").rightPush(mymessage);

Is there any way I can generate the Key and pass it while adding the "message" ?

Christoph Strobl
  • 6,491
  • 25
  • 33
user3101143
  • 137
  • 1
  • 3
  • 10

1 Answers1

1

RedisTemplate.boundListOps(K key) gives you access to list commands that all get executed against the key used for obtaining the BoundListOperations. You can use RedisTemplate.opsForList() in case you want to get ListOperations which is not bound to a specific key and then call rightPush(K key, V value) there.

Christoph Strobl
  • 6,491
  • 25
  • 33