Configuring Client Discovery using Core
38.2.4.2. Configuring client discovery using Core If you're using the core API to directly instantiate ClientSessionFactory instances, then you can specify the discovery group parameters directly when creating the session factory. Here's an example: final String groupAddress = "231.7.7.7"; final int groupPort = 9876; SessionFactory factory = HornetQClient.createClientSessionFactory(groupAddress, groupPort); ClientSession session1 = factory.createClientSession(...); ClientSession session2 = factory.createClientSession(...); The refresh-timeout can be set directly on the session factory by using the setter method setDiscoveryRefreshTimeout() if you want to change the default value. There is also a further parameter settable on the session factory using the setter method setDiscoveryInitialWaitTimeout(). If the session factory is used immediately after creation then it may not have had enough time to received broadcasts from all the nodes in the cluster. On first usage, the session factory will make sure it waits this long since creation before creating the first session. The default value for this parameter is 10000 milliseconds.