Cache KeyGenerator.extract() should allow to use the bean identity [SPR-7971] #12626
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Sylvain LAURENT opened SPR-7971 and commented
The new org.springframework.cache.KeyGenerator<K> interface introduced with 3.1M1 does not allow to generate a key that would take the identity of the bean into account.
Imagine that a method of a service is annotated with
@Cacheable
and I deploy 2 instances of the service each with its own configuration. There is no way I can provide a KeyGenerator implementation that generates 2 different keys for the same arguments passed to the 2 different instances of the service.The signature of the extract method should be augmented with a String that is the id of the target Spring bean in its beanFactory.
Affects: 3.1 M1
Referenced from: commits 5c3ceb8
1 votes, 1 watchers
The text was updated successfully, but these errors were encountered: