Skip to content

Instantly share code, notes, and snippets.

@gurbuzali
Created January 8, 2016 19:20
Show Gist options
  • Save gurbuzali/d8e83db2f24a9f73359d to your computer and use it in GitHub Desktop.
Save gurbuzali/d8e83db2f24a9f73359d to your computer and use it in GitHub Desktop.
Config config = new Config();
QueueConfig queueConfig = config.getQueueConfig("queue");
queueConfig.setEmptyQueueTtl(5);
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
IQueue<Object> queue = instance.getQueue("queue");
int size = instance.getDistributedObjects().size();
System.err.println("Size [" + size + "] should be 1");
queue.offer("item");
queue.poll();
sleepSeconds(10);
size = instance.getDistributedObjects().size();
System.err.println("Size [" + size + "] should be 0");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment