TransportConfiguration config = new TransportConfiguration(InVMConnectorFactory.class.getName());
ClientSessionFactory csf = HornetQClient.createClientSessionFactory(config);
ExecutorService executorService = Executors.newFixedThreadPool(1);
ScheduledExecutorService scheduledexecutorService = Executors.newScheduledThreadPool(1);
FailoverManagerImpl failoverManager = new FailoverManagerImpl(csf,
config,
null,
HornetQClient.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN,
HornetQClient.DEFAULT_CALL_TIMEOUT,
HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
500,
HornetQClient.DEFAULT_RETRY_INTERVAL,
HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
HornetQClient.DEFAULT_RECONNECT_ATTEMPTS,
HornetQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION,
executorService,
scheduledexecutorService,
null);
connection = failoverManager.getConnection();
}