Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2207

How to use in memory and redis cache in the same project?

$
0
0

Have two classes, both annotating with @Cacheable (org.springframework.cache.annotation.Cacheable), either methods or class. I think it doesn't matter for this question.

Example:

@Cacheable(value = STATE_CACHE_NAME, key = "#root.methodName +'-'+ #country?.id ?: \"null\" +'-'+ #stateName ?: \"null\"")public Long getStateId(CountryEntity country, String stateName) {...}

In some classes I'd like to use a simple in-memory cache and others a Redis cache. How do I state this intent?


Viewing all articles
Browse latest Browse all 2207

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>