@ Override public String serviceToUrl ( String protocol , String serviceId , String tag , String requestKey ) { URL url = loadBalance . select ( discovery ( protocol , serviceId , tag ) , requestKey ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "final url after load balance = " + url ) ; // construct a url in string return protocol + "://" + url . getHost ( ) + ":" + url . getPort ( ) ; }
Implement serviceToUrl with client side service discovery .