/** * Initialize the service discovery client, we will reuse that * every time we need to create a new client. */ private void initDiscovery() { if (discoveryServiceClient == null) { LOG.info("No DiscoveryServiceClient provided. Skipping service discovery."); return; } endpointStrategy = new TimeLimitEndpointStrategy( new RandomEndpointStrategy( discoveryServiceClient.discover( configuration.get(TxConstants.Service.CFG_DATA_TX_DISCOVERY_SERVICE_NAME, TxConstants.Service.DEFAULT_DATA_TX_DISCOVERY_SERVICE_NAME))), configuration.getInt(TxConstants.Service.CFG_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC, TxConstants.Service.DEFAULT_DATA_TX_CLIENT_DISCOVERY_TIMEOUT_SEC), TimeUnit.SECONDS); }