@Singleton @Requires(beans=EurekaClient.class) @Requires(property="micronaut.application.name") public class EurekaAutoRegistration extends DiscoveryServiceAutoRegistration
AutoRegistration
that registers with Eureka.LOG
Modifier | Constructor and Description |
---|---|
protected |
EurekaAutoRegistration(Environment environment,
EurekaClient eurekaClient,
EurekaConfiguration eurekaConfiguration,
HeartbeatConfiguration heartbeatConfiguration,
ServiceInstanceIdGenerator idGenerator) |
Modifier and Type | Method and Description |
---|---|
protected void |
customizeInstanceInfo(InstanceInfo instanceInfo)
Subclasses can override to customize the instance info.
|
protected void |
deregister(ServiceInstance instance)
Deregister the
ServiceInstance from service discovery services. |
protected void |
pulsate(ServiceInstance instance,
HealthStatus status)
This method will be invoked each time a
HeartbeatEvent occurs allowing the implementation to perform any necessary callbacks to the service discovery server. |
protected void |
register(ServiceInstance instance)
Register the
ServiceInstance with discovery services. |
protected InstanceInfo.Status |
translateState(HealthStatus status)
Translate a
HealthStatus to a Eureka InstanceInfo.Status . |
getErrorMessage, performDeregistration, performRegistration
onApplicationEvent, validateApplicationName, validateName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supports
protected EurekaAutoRegistration(Environment environment, EurekaClient eurekaClient, EurekaConfiguration eurekaConfiguration, HeartbeatConfiguration heartbeatConfiguration, ServiceInstanceIdGenerator idGenerator)
environment
- The environmenteurekaClient
- The Eureka clienteurekaConfiguration
- The Eureka configurationheartbeatConfiguration
- The Heartbeat configurationidGenerator
- The id generatorprotected void pulsate(ServiceInstance instance, HealthStatus status)
AutoRegistration
HeartbeatEvent
occurs allowing the implementation to perform any necessary callbacks to the service discovery server.pulsate
in class AutoRegistration
instance
- The instancestatus
- The HealthStatus
protected InstanceInfo.Status translateState(HealthStatus status)
HealthStatus
to a Eureka InstanceInfo.Status
.status
- The statusInstanceInfo.Status
instanceprotected void deregister(ServiceInstance instance)
AutoRegistration
ServiceInstance
from service discovery services.deregister
in class AutoRegistration
instance
- The ServiceInstance
protected void register(ServiceInstance instance)
AutoRegistration
ServiceInstance
with discovery services.register
in class AutoRegistration
instance
- The ServiceInstance
protected void customizeInstanceInfo(InstanceInfo instanceInfo)
instanceInfo
- The instance info