java - Spring Cache: Using memcached as a distributed cache -
for number of java services we're using aws elasticache distributed cache integrated spring cache abstraction , spymemcached.
in 1 service see behaviour diffent type of result expect, leading classcastexception. precise: have cache key , result expect list, instead result of type2.
we have defined number of caches, of use same cache key:
cache1: cachekey -> list<type1> cache2: cachekey -> type2
since in different caches, works when use simple hashmap based cache. elasticache/memcached seems don't have different caches (which make sense know of memcached - not much).
i have expected spymemcached take care of manipulating cache keys application wouldnt need aware of actual cache implementation (this done manipulating cache keys , prefixing them cache name i.e.).
from few debugging sessions , errors see, doesn't seem case.
i've looked @ class:
com.google.code.ssm.spring.ssmcache
l82: value = cache.get(getkey(key), null); l154: private string getkey(final object key) { l155: return key.tostring(); l156: }
i have expected have getkey() method prefix cache name.
so questions are:
- do understand correctly going on here?
- is there maybe can configured spymemcached make behave in expected way?
also, other thoughts appriciated! thanks!
ok, found issue version 3.2.0 of simple-spring-memcached. version 3.3.0 fixes it.
Comments
Post a Comment