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

    Constructors
    Modifier
    Constructor
    Description
    protected
    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 Type
    Method
    Description
    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 used
    protected 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 environment
      consulClient - The Consul client
      heartbeatConfiguration - The heartbeat configuration
      consulConfiguration - The Consul configuration
      idGenerator - The id generator
  • Method Details

    • pulsate

      protected void pulsate(io.micronaut.discovery.ServiceInstance instance, io.micronaut.health.HealthStatus status)
      Specified by:
      pulsate in class io.micronaut.discovery.registration.AutoRegistration
    • deregister

      protected void deregister(io.micronaut.discovery.ServiceInstance instance)
      Specified by:
      deregister in class io.micronaut.discovery.registration.AutoRegistration
    • register

      protected void register(io.micronaut.discovery.ServiceInstance instance)
      Specified by:
      register in class io.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 used
      Allows sub classes to override and customize the configuration.
      Parameters:
      instance - The instance
      serviceEntry - The service entry