Class ConsulServiceInstanceList

java.lang.Object
io.micronaut.discovery.client.DiscoveryServerInstanceList
io.micronaut.discovery.consul.ConsulServiceInstanceList
All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.server.event.ServerStartupEvent>, io.micronaut.core.order.Ordered, io.micronaut.discovery.ServiceInstanceList, EventListener

@Singleton @RequiresConsul public class ConsulServiceInstanceList extends DiscoveryServerInstanceList

A ServiceInstanceList for Consul which reads from the ConsulConfiguration.

The reason this is useful is if a RefreshEvent occurs then the ConsulConfiguration will be updated and the backing list of ServiceInstance changed at runtime.

Since:
1.0
Author:
graemerocher
  • Constructor Details

    • ConsulServiceInstanceList

      public ConsulServiceInstanceList(ConsulConfiguration configuration, io.micronaut.runtime.ApplicationConfiguration.InstanceConfiguration instanceConfiguration)
      Creates a new consul service instance list.
      Parameters:
      configuration - The discovery config
      instanceConfiguration - The instance config
  • Method Details

    • getID

      public String getID()