use of org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpoint in project activemq-artemis by apache.
the class SimpleJNDIClientTest method testRemoteCFWithJgroupsWithTransportConfigFile.
@Test
public void testRemoteCFWithJgroupsWithTransportConfigFile() throws Exception {
Hashtable<String, String> props = new Hashtable<>();
props.put(Context.INITIAL_CONTEXT_FACTORY, org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory.class.getCanonicalName());
props.put("connectionFactory.myConnectionFactory", "jgroups://testChannelName?file=test-jgroups-file_ping.xml&" + ActiveMQInitialContextFactory.REFRESH_TIMEOUT + "=5000&" + ActiveMQInitialContextFactory.DISCOVERY_INITIAL_WAIT_TIMEOUT + "=6000");
Context ctx = new InitialContext(props);
ActiveMQConnectionFactory cf = (ActiveMQConnectionFactory) ctx.lookup("myConnectionFactory");
DiscoveryGroupConfiguration discoveryGroupConfiguration = cf.getDiscoveryGroupConfiguration();
Assert.assertEquals(5000, discoveryGroupConfiguration.getRefreshTimeout());
Assert.assertEquals(6000, discoveryGroupConfiguration.getDiscoveryInitialWaitTimeout());
BroadcastEndpoint broadcastEndpoint = cf.getDiscoveryGroupConfiguration().getBroadcastEndpointFactory().createBroadcastEndpoint();
Assert.assertTrue(broadcastEndpoint instanceof JGroupsFileBroadcastEndpoint);
broadcastEndpoint.close(false);
}
Aggregations