Class EurekaAutoRegistration

java.lang.Object
io.micronaut.discovery.registration.AutoRegistration
io.micronaut.discovery.client.registration.DiscoveryServiceAutoRegistration
io.micronaut.discovery.eureka.registration.EurekaAutoRegistration
All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.discovery.event.AbstractServiceInstanceEvent>, EventListener

@Singleton @Requires(beans={EurekaClient.class,io.micronaut.runtime.server.EmbeddedServer.class}) @Requires(property="micronaut.application.name") public class EurekaAutoRegistration extends DiscoveryServiceAutoRegistration
A AutoRegistration that registers with Eureka.
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
    EurekaAutoRegistration(io.micronaut.context.env.Environment environment, EurekaClient eurekaClient, EurekaConfiguration eurekaConfiguration, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Subclasses can override to customize the instance info.
    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)
     
    translateState(io.micronaut.health.HealthStatus status)
    Translate a HealthStatus to a Eureka InstanceInfo.Status.

    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

    • EurekaAutoRegistration

      protected EurekaAutoRegistration(io.micronaut.context.env.Environment environment, EurekaClient eurekaClient, EurekaConfiguration eurekaConfiguration, io.micronaut.health.HeartbeatConfiguration heartbeatConfiguration, io.micronaut.discovery.ServiceInstanceIdGenerator idGenerator)
      Parameters:
      environment - The environment
      eurekaClient - The Eureka client
      eurekaConfiguration - The Eureka configuration
      heartbeatConfiguration - The Heartbeat 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
    • translateState

      protected InstanceInfo.Status translateState(io.micronaut.health.HealthStatus status)
      Translate a HealthStatus to a Eureka InstanceInfo.Status.
      Parameters:
      status - The status
      Returns:
      The InstanceInfo.Status instance
    • 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
    • customizeInstanceInfo

      protected void customizeInstanceInfo(InstanceInfo instanceInfo)
      Subclasses can override to customize the instance info.
      Parameters:
      instanceInfo - The instance info