Make sure Hazelcast bootstraps before any JCache setup
This commit makes sure that if a `javax.cache.CacheManager` is required, an auto-configured `HazelcastInstance` is fully resolved first. This prevents the case where the JCache bootstrap actually starts an instance early, followed by a second (potentially unwanted) instance created by the regular auto-configuration. Since the JCache implementation works with an `HazelcastInstance` behind the scenes, if there is one `HazelcastInstance` configured and it has a name, then we configure the `CacheProvider` to use that. Future Hazelcast version will allow to pass the instance directly (i.e. not requiring an actual name). Closes gh-8484
This commit is contained in:
@@ -3984,6 +3984,10 @@ NOTE: Since a cache library may offer both a native implementation and JSR-107 s
|
||||
Spring Boot will prefer the JSR-107 support so that the same features are available if
|
||||
you switch to a different JSR-107 implementation.
|
||||
|
||||
TIP: Spring Boot has a <<boot-features-hazelcast,general support for Hazelcast>>t. If
|
||||
a single `HazelcastInstance` is available, it is automatically reused for the
|
||||
`CacheManager` as well unless the `spring.cache.jcache.config` property is specified.
|
||||
|
||||
There are several ways to customize the underlying `javax.cache.cacheManager`:
|
||||
|
||||
* Caches can be created on startup via the `spring.cache.cache-names` property. If a
|
||||
|
||||
Reference in New Issue
Block a user