0

I want to use "redisson-tomcat" library to store tomcat session in redis. But I need to add key prefix before storing sessions in redis. Is there any way to add session key prefix when storing sessions in redis ? As per my finding I need to configure "RedissonSessionManager" with tomcat. like bellow

<Manager className="org.redisson.tomcat.RedissonSessionManager" configPath="${catalina.base}/redisson.conf" readMode="MEMORY" updateMode="DEFAULT"/>

it looks like lot of thinks can be configured using "redisson.conf" file but, I don't see any configuration to add key prefix.

Can anyone help me on this ?

faisalbegins
  • 39
  • 1
  • 7

2 Answers2

0

It looks like redison-tomcat currently don't have this feature, as a work around I extended RedissonSessionManager and overridden getMap method to set custom session key prefix RedissonSessionManager::getMap. I have also send them a pull request which includes this feature. If anyone is interested your can also have a look at the pull request

faisalbegins
  • 39
  • 1
  • 7
0

Try to add keyprefix in your code.

<Manager className="org.redisson.tomcat.RedissonSessionManager"
      configPath="${catalina.base}/redisson.conf" readMode="MEMORY" updateMode="DEFAULT" keyPrefix="yourPrefix" />
Alien
  • 15,141
  • 6
  • 37
  • 57