Hibernate configuration with Hazelcast Cloud

24 views
Skip to first unread message

Mark Bhatambrekar

unread,
Nov 24, 2019, 1:33:03 AM11/24/19
to haze...@googlegroups.com
Hi

I would like to know how can configure hazelcast cloud with Grails Hibernate,
I am not able to find any documentation on it, any pointer would be great help,

There is a hazel grails plugin but that does not show the configuration that needs to be done for hibernate with hazelcast cloud
--

--
Best Regards
Mark(Makarand) Bhatamrekar
CanaryLogic LLC(Formerly - Harvest Infotech LLC),
Alpharetta, GA 30022 
678-685-1730 ma...@canarylogic.com

Rafal Leszko

unread,
Nov 24, 2019, 8:48:23 AM11/24/19
to haze...@googlegroups.com
Hi Mark,

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ł

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/CANY3q%3D4Ea%2B8HFV%3D%3De51OhRKNXaiTndVAoCpr-jH4NcTuFZ7Y8Q%40mail.gmail.com.


--
Rafał Leszko
Software Engineer
@RafalLeszko
Reply all
Reply to author
Forward
0 new messages