@ -41,7 +41,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.cloud.client.serviceregistry.Registration ;
import org.springframework.cloud.client.serviceregistry.ServiceRegistry ;
import static java.util.concurrent.TimeUnit. MILLI SECONDS;
import static java.util.concurrent.TimeUnit. SECONDS;
import static org.springframework.util.ReflectionUtils.rethrowRuntimeException ;
/ * *
@ -69,8 +69,8 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
this . staticMetadataManager = staticMetadataManager ;
if ( polarisDiscoveryProperties . isHeartbeatEnabled ( ) ) {
this . heartbeatExecutor = Executors . newSingleThreadScheduledExecutor (
new NamedThreadFactory ( " spring-cloud -heartbeat") ) ;
this . heartbeatExecutor = Executors
. newSingleThreadScheduledExecutor ( new NamedThreadFactory ( " polaris -heartbeat") ) ;
}
else {
this . heartbeatExecutor = null ;
@ -207,13 +207,14 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
}
polarisDiscoveryHandler . getProviderAPI ( ) . heartbeat ( heartbeatRequest ) ;
LOGGER . trace ( "Polaris heartbeat is sent" ) ;
}
catch ( PolarisException e ) {
LOGGER . error ( "polaris heartbeat [{}]", e . getCode ( ) , e ) ;
LOGGER . error ( "polaris heartbeat error with code [{}]", e . getCode ( ) , e ) ;
}
catch ( Exception e ) {
LOGGER . error ( "polaris heartbeat runtime error" , e ) ;
}
} , polarisDiscoveryProperties . getHeartbeatInterval ( ) , polarisDiscoveryProperties . getHeartbeatInterval ( ) , MILLI SECONDS) ;
} , polarisDiscoveryProperties . getHeartbeatInterval ( ) , polarisDiscoveryProperties . getHeartbeatInterval ( ) , SECONDS) ;
}
}