Created
January 8, 2016 19:20
-
-
Save gurbuzali/d8e83db2f24a9f73359d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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