-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide a callback that enables customization of the properties used to create the JCache CacheManager #39350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
JCachePropertiesCustomizer
public again
Making |
I see. Not sure if this is a good idea, but how about introducing a new public customizer interface that takes a |
I think we could even change the existing callback so that it only takes the https://github.com/wilkinsona/spring-boot/tree/gh-39350 |
JCachePropertiesCustomizer
public again
I created PR #41209, PTAL :) |
Thanks, @belowyoon, but, as mentioned above, we already have these changes prepared in a branch that we'll merge in due course. |
I am facing the same need of Issue #29542 to set custom object into
Properties
object that are passed into theCachingProvider.getCacheManager(URI, ClassLoader, Properties)
call.Specifically, I am setting up Infinispan with Spring Boot via the JCache method, as opposed to using
infinispan-spring-boot3-starter-embedded
or usingInfinispanCacheConfiguration
. Based on the Infinispan'sJCacheManager
documentation, it is possible to customize the global configuration and cache configuration using Java code. This can be achieved by passing in customizer function to theProperties
object withGLOBAL_CONFIGURATION_CONSUMER
andCACHE_CONFIGURATION_FUNCTION
keys, and these functions will get called duringCachingProvider.getCacheManager(URI, ClassLoader, Properties)
andCacheManager.create(String, C)
call respectively.Here is an example configuration class demostrating the use of
GLOBAL_CONFIGURATION_CONSUMER
andCACHE_CONFIGURATION_FUNCTION
keys:However, I would prefer to make use of
JCacheCacheConfiguration
class so that I can replace thecacheManager.createCache("mylists", MutableConfiguration<SimpleKey, String>())
call with the spring boot propertyspring.cache.cache-names=mylists
The text was updated successfully, but these errors were encountered: