Class ConsulAutoRegistration
java.lang.Object
io.micronaut.discovery.registration.AutoRegistration
io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
io.micronaut.discovery.consul.registration.ConsulAutoRegistration
- All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.discovery.event.AbstractServiceInstanceEvent>
,EventListener
@Singleton
@Requires(beans={ConsulClient.class,ConsulConfiguration.class})
public class ConsulAutoRegistration
extends DiscoveryServiceAutoRegistration
Auto registration implementation for consul.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.discovery.registration.AutoRegistration
LOG, registered
-
Constructor Summary
ModifierConstructorDescriptionprotected
ConsulAutoRegistration
(io.micronaut.context.env.Environment environment, ConsulClient consulClient, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, ConsulConfiguration consulConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizeServiceEntry
(io.micronaut.discovery.ServiceInstance instance, ConsulNewServiceEntry serviceEntry) Deprecated, for removal: This API element is subject to removal in a future version.no longer usedprotected void
deregister
(io.micronaut.discovery.ServiceInstance instance) protected void
pulsate
(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status) protected void
register
(io.micronaut.discovery.ServiceInstance instance) Methods inherited from class io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
getErrorMessage, performDeregistration, performRegistration
Methods inherited from class io.micronaut.discovery.registration.AutoRegistration
onApplicationEvent, validateApplicationName, validateName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.context.event.ApplicationEventListener
supports
-
Constructor Details
-
ConsulAutoRegistration
protected ConsulAutoRegistration(io.micronaut.context.env.Environment environment, ConsulClient consulClient, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, ConsulConfiguration consulConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator) - Parameters:
environment
- The environmentconsulClient
- The Consul clientheartbeatConfiguration
- The heartbeat configurationconsulConfiguration
- The Consul configurationidGenerator
- The id generator
-
-
Method Details
-
pulsate
protected void pulsate(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status) - Specified by:
pulsate
in classio.micronaut.discovery.registration.AutoRegistration
-
deregister
protected void deregister(io.micronaut.discovery.ServiceInstance instance) - Specified by:
deregister
in classio.micronaut.discovery.registration.AutoRegistration
-
register
protected void register(io.micronaut.discovery.ServiceInstance instance) - Specified by:
register
in classio.micronaut.discovery.registration.AutoRegistration
-
customizeServiceEntry
@Deprecated(forRemoval=true, since="4.1.0") protected void customizeServiceEntry(io.micronaut.discovery.ServiceInstance instance, ConsulNewServiceEntry serviceEntry) Deprecated, for removal: This API element is subject to removal in a future version.no longer usedAllows sub classes to override and customize the configuration.- Parameters:
instance
- The instanceserviceEntry
- The service entry
-