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 ) ) ) , 2 , TimeUnit . SECONDS ) ; }
Initialize the service discovery client we will reuse that every time we need to create a new client .