I have one question about JCache declarative configuration in hazelcast. I've read documentation but somehow I can't find an answer yet, so I'd much appreciate any help.
I'd like to configure my caches kind of dynamically (it applies mostly to hazelcast client but for server side probably should be the same). I need to join existing cluster (given hazelcast client/server instance with it own configuration) and then get cache manager with a declarative configuration of needed caches, something like this:
//server HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(hzConfig); CachingProvider caching = Caching.getCachingProvider("com.hazelcast.cache.impl.HazelcastServerCachingProvider"); Properties properties = new Properties(); properties.setProperty( HazelcastCachingProvider.HAZELCAST_INSTANCE_NAME, hazelcastInstance.getName()); CacheManager cacheManager = caching.getCacheManager(new URI("classpath:hz-my-cache-test.xml"), null, properties); Cache<Long, Object> cache = cacheManager.getCache("my-cache-name");
The same direction is for the client but with proper client caching provider, etc.
Is it possible at all?
Somehow from [THIS] (https://docs.hazelcast.org/docs/latest/manual/html-single/#scoping-to-join-clusters) hazelcast documentation I didn't get it and my prototype app doesn't read such configured caches. Although putting cache configuration directly into
hazelcast.xml works just fine.
Target of invocation cannot be found! Partition owner is null but partitions can't be assigned since all nodes in the cluster are lite members.