Skip to content

Instantly share code, notes, and snippets.

@mattyb149
Created February 11, 2016 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattyb149/1e32b1b2fec49ccd5deb to your computer and use it in GitHub Desktop.
Save mattyb149/1e32b1b2fec49ccd5deb to your computer and use it in GitHub Desktop.
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