version 3.6.1
I am running the below example [SampleDistObjListener] with a non-default cluster.xml.The cluster.xml defines several objects (Maps, etc.). I am expecting to see the list of the object names printed once the Hazelcast instance had started, but I see none.
Collection<DistributedObject> distributedObjects = hazelcastInstance.getDistributedObjects();
for (DistributedObject distributedObject : distributedObjects) {
System.out.println(distributedObject.getName() + "," + distributedObject.getServiceName());
}
example:
http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#listening-for-distributed-object-eventsrunning as:
java -Dhazelcast.config=cluster.xml -classpath hazelcast-all-3.6.1.jar:. SampleDistObjListener
The objects seem to appear on the list once I "touch" them in the code "hazelcastInstance.getMap(...)" but not until then. Am I incorrect assuming that a Map defined via cluster.xml gets created at start-up?
Any ideas?
Thank you for your response