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:

  1. do understand correctly going on here?
  2. 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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -