Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Groovy script to seed Hazelcast instance for ExecuteScript example
@Grab(group='com.hazelcast', module='hazelcast', version='3.6')
@Grab(group='com.hazelcast', module='hazelcast-client', version='3.6')
import com.hazelcast.client.*
import com.hazelcast.client.config.*
import com.hazelcast.core.*
ClientConfig clientConfig = new ClientConfig();
clientConfig.getGroupConfig().setName("dev").setPassword("dev-pass");
clientConfig.getNetworkConfig().addAddress("192.168.99.100", "192.168.99.100:32780");
client = HazelcastClient.newHazelcastClient(clientConfig)
client.getMap("customers").put('mattyb149', ['name': 'Matt Burgess', 'email': 'mattyb149@gmail.com', 'blog': 'funnifi.blogspot.com'])
client.getMap("customers").put('nifi', ['name': 'Apache NiFi', 'email': 'nifi@apache.org', 'blog': 'nifi.apache.org'])
client?.shutdown()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment