We should probably publish a blog post on that or add it to the documention, but in short you need to create HazelcastInstance with the client configuration like this:
ClientConfig clientConfig = new ClientConfig();
clientConfig.getNetworkConfig().getCloudConfig()
.setEnabled(true)
.setDiscoveryToken("YOUR_DISCOVERY_TOKEN");
clientConfig.setGroupConfig(new GroupConfig(
"YOUR_CLUSTER_NAME",
"YOUR_CLUSTER_PASSWORD")
);
HazelcastInstance hazelcastInstance = HazelcastClient.newHazelcastClient(clientConfig);
Then, you need to assign this instance as the Hibernate JPA property like this:
hibernateJpaProperties.setProperty("hibernate.cache.hazelcast.instance_name", hazelcastInstance.getName());Hope it helps,
Rafał