@Singleton @Requires(beans={ConsulClient.class,ConsulConfiguration.class}) public class ConsulAutoRegistration extends DiscoveryServiceAutoRegistration
LOG
Modifier | Constructor and Description |
---|---|
protected |
ConsulAutoRegistration(Environment environment,
ConsulClient consulClient,
HeartbeatConfiguration heartbeatConfiguration,
ConsulConfiguration consulConfiguration,
ServiceInstanceIdGenerator idGenerator) |
Modifier and Type | Method and Description |
---|---|
protected void |
customizeServiceEntry(ServiceInstance instance,
NewServiceEntry serviceEntry)
Allows sub classes to override and customize the configuration.
|
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. |
getErrorMessage, performDeregistration, performRegistration
onApplicationEvent, validateApplicationName, validateName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supports
protected ConsulAutoRegistration(Environment environment, ConsulClient consulClient, HeartbeatConfiguration heartbeatConfiguration, ConsulConfiguration consulConfiguration, ServiceInstanceIdGenerator idGenerator)
environment
- The environmentconsulClient
- The Consul clientheartbeatConfiguration
- The heartbeat configurationconsulConfiguration
- The Consul 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 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 customizeServiceEntry(ServiceInstance instance, NewServiceEntry serviceEntry)
instance
- The instanceserviceEntry
- The service entry