Class FixedLoadBalancer

java.lang.Object
io.micronaut.http.client.loadbalance.FixedLoadBalancer
All Implemented Interfaces:
LoadBalancer

public class FixedLoadBalancer extends Object implements LoadBalancer
A LoadBalancer that resolves a fixed URI.
Since:
1.0
  • Constructor Details

    • FixedLoadBalancer

      @Deprecated public FixedLoadBalancer(URL url)
      Deprecated.
      Constructs a new FixedLoadBalancer.
      Parameters:
      url - The URL to fix to
    • FixedLoadBalancer

      public FixedLoadBalancer(URI uri)
      Constructs a new FixedLoadBalancer.
      Parameters:
      uri - The URI to fix to
  • Method Details

    • select

      public org.reactivestreams.Publisher<io.micronaut.discovery.ServiceInstance> select(@Nullable @Nullable Object discriminator)
      Specified by:
      select in interface LoadBalancer
      Parameters:
      discriminator - An object used to discriminate the server to select. Usually the service ID
      Returns:
      The selected ServiceInstance
    • getUrl

      @Deprecated public URL getUrl()
      Deprecated.
      Use getUri() instead
      Returns:
      The URL of the LoadBalancer
    • getUri

      public URI getUri()
      Returns:
      The URI of the LoadBalancer
    • getServiceInstance

      @Internal public io.micronaut.discovery.ServiceInstance getServiceInstance()
      The fixed ServiceInstance returned by select(java.lang.Object). Internal use only.
      Returns:
      The service instance
    • getContextPath

      public Optional<String> getContextPath()
      Specified by:
      getContextPath in interface LoadBalancer
      Returns:
      The context path to use for requests.