Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CachingProvider no longer resolves URI as instance name #15995
Reasoning: in this config mode,
The ability to use an existing
Reasoning: in this config mode, URI is used both as namespace for the cache manager and as a means to locate a running HZ instance. With moby naming auto generating instance names in 4.0 (when not explicitly set in configuration), the following snippet when executed from 2 processes will result in creation of two separate Cache instances which is probably not what a user would expect: System.setProperty("hazelcast.jcache.provider.type", "server"); HazelcastInstance hz = Hazelcast.newHazelcastInstance(); CachingProvider provider = Caching.getCachingProvider(); Cache cache = provider.getCacheManager(new URI(hz.getName()), null) .createCache("test", new CacheConfig()); System.out.println(cache.get("a")); cache.put("a", "b"); The ability to use an existing HazelcastInstance identified by instance name is still available by using Properties via CachingProvider#getCacheManager(URI, ClassLoader, Properties). This way to integrate with existing hazelcast instances is unambiguous and explicit.