Hi,

Is there any to enable near cache only on client nodes?

I am using partitioned cache and using colocation to submit the ignite
jobs. But in my code I do few lookups on client node to validate the data.
To improve this lookup performance I want to enable near cache.

I  saw the example on GitHub and in ignite docs. But I am still struggling
to configure near cache on client nodes only.

This my Ignite configuration on client node. All the cache configurations
are defined only on ignite server nodes.

Can some please tell me where to include near cache configuration in
following config?

private IgniteConfiguration getIgniteConfiguration(IgniteSpringBean ignite) {

  String[] hosts = appConfigProperties.getHosts().split(",");
  TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
  ipFinder.setAddresses(Arrays.asList(hosts));

  TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
  discoSpi.setIpFinder(ipFinder);

  IgniteConfiguration cfg = new IgniteConfiguration();
  cfg.setDiscoverySpi(discoSpi);
  cfg.setIgniteInstanceName("springDataNode");
  cfg.setPeerClassLoadingEnabled(false);
  cfg.setRebalanceThreadPoolSize(4);
  cfg.setClientFailureDetectionTimeout(failureDetectionTimeout);
  //cfg.setLifecycleBeans(new IgniteLifeCycleBean());
  cfg.setClientMode(true);
  HashMap<String, String> attributeMap = new HashMap<>();
  attributeMap.put(NODE_TYPE,NODE_TYPE_WEB);
  cfg.setUserAttributes(attributeMap);

  return cfg;
}



Thanks,
Prasad

Reply via email to