Announcement Announcement Module
Collapse
No announcement yet.
Can I use more than one java object type in redis templ with @Cacheable? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can I use more than one java object type in redis templ with @Cacheable?

    Is there any way I can use more than one redis template or change the value type to another object dynamically in the template for the CacheManager to use? I have multiple java objects that I want to cache using the @Cacheable annotation but It seems I can only declare one template with a specific object for the Cache Manager to use. Is there a easy way to do this or do I need to create some utility class that would convert these java objects to String and use the string redis template?

  • #2
    There are some suggestions in this JIRA issue that might be helpful, such as injecting RedisTemplate with a serializer that can handle objects of different types:

    https://jira.springsource.org/browse/DATAREDIS-175

    Comment

    Working...
    X