I want to cache two different Java objects or POJOS in two different regions in Redis. I want the following region structure in Redis.
MyRegions::Product
MyRegions::Order
The Product objects should be saved under MyRegions::Product and the Order objects should be saved under MyRegions::Order
I don't want to use @Cacheable(cacheNames = "RegionName") and @CachePut(cacheNames = "RegionName") as it didn't work in my office project. I am forced to use org.springframework.data.redis.core.RedisTemplate as I need to save the object in a format that is human readable.
I'm using the below serializers
StringRedisSerializer for serializing keys
GenericToStringSerializer for serializing HashValue
GenericJackson2JsonRedisSerializer for serializing Values.
Below is the link to the project in my Git Repo.https://github.com/abhijitnath90/spring-boot-redis-example.githttps://github.com/abhijitnath90/spring-boot-redis-example