Interface HttpClientRegistry<T extends HttpClient>

Type Parameters:
T - Reactive HTTP Client

public interface HttpClientRegistry<T extends HttpClient>
Interface for managing the construction and lifecycle of instances of HttpClient clients.
Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    disposeClient(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
    Dispose of the client defined by the given metadata.
    getClient(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
    Return the client for the given annotation metadata.
    getClient(@NonNull HttpVersionSelection httpVersion, @NonNull String clientId, @Nullable String path)
    Return the client for the client ID and path.
    default T
    getClient(io.micronaut.http.HttpVersion httpVersion, @NonNull String clientId, @Nullable String path)
    default T
     
    resolveClient(@Nullable io.micronaut.inject.InjectionPoint<?> injectionPoint, @Nullable LoadBalancer loadBalancer, @Nullable HttpClientConfiguration configuration, @NonNull io.micronaut.context.BeanContext beanContext)
    Resolves a HttpClient for the given injection point.
  • Method Details

    • getClient

      @NonNull T getClient(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Return the client for the given annotation metadata.
      Parameters:
      annotationMetadata - The annotation metadata.
      Returns:
      The client
    • getClient

      @Deprecated @NonNull default T getClient(io.micronaut.http.HttpVersion httpVersion, @NonNull @NonNull String clientId, @Nullable @Nullable String path)
      Return the client for the client ID and path.
      Parameters:
      httpVersion - The HTTP version
      clientId - The client ID
      path - The path (Optional)
      Returns:
      The client
    • getClient

      @NonNull T getClient(@NonNull @NonNull HttpVersionSelection httpVersion, @NonNull @NonNull String clientId, @Nullable @Nullable String path)
      Return the client for the client ID and path.
      Parameters:
      httpVersion - The HTTP version
      clientId - The client ID
      path - The path (Optional)
      Returns:
      The client
      Since:
      4.0.0
    • resolveClient

      @NonNull T resolveClient(@Nullable @Nullable io.micronaut.inject.InjectionPoint<?> injectionPoint, @Nullable @Nullable LoadBalancer loadBalancer, @Nullable @Nullable HttpClientConfiguration configuration, @NonNull @NonNull io.micronaut.context.BeanContext beanContext)
      Resolves a HttpClient for the given injection point.
      Parameters:
      injectionPoint - The injection point
      loadBalancer - The load balancer to use (Optional)
      configuration - The configuration (Optional)
      beanContext - The bean context to use
      Returns:
      The HTTP Client
    • disposeClient

      void disposeClient(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Dispose of the client defined by the given metadata.
      Parameters:
      annotationMetadata - The annotation metadata
    • getDefaultClient

      default T getDefaultClient()
      Returns:
      Return the default HTTP client.