Annotation Type FeignClient


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited public @interface FeignClient
Annotation for interfaces declaring that a REST client with that interface should be created (e.g. for autowiring into another component). If SC LoadBalancer is available it will be used to load balance the backend requests, and the load balancer can be configured using the same name (i.e. value) as the feign client.
Author:
Spencer Gibb, Venil Noronha, Olga Maciaszek-Sharma
  • Element Details

    • value

      @AliasFor("name") String value
      The name of the service with optional protocol prefix. Synonym for name. A name must be specified for all clients, whether or not a url is provided. Can be specified as property key, eg: ${propertyKey}.
      Returns:
      the name of the service with optional protocol prefix
      Default:
      ""
    • contextId

      String contextId
      This will be used as the bean name instead of name if present, but will not be used as a service id.
      Returns:
      bean name instead of name if present
      Default:
      ""
    • name

      @AliasFor("value") String name
      Returns:
      The service id with optional protocol prefix. Synonym for value.
      Default:
      ""
    • qualifier

      @Deprecated String qualifier
      Deprecated.
      in favour of qualifiers(). If both qualifier() and qualifiers() are present, we will use the latter, unless the array returned by qualifiers() is empty or only contains null or whitespace values, in which case we'll fall back first to qualifier() and, if that's also not present, to the default = contextId + "FeignClient".
      Returns:
      the @Qualifier value for the feign client.
      Default:
      ""
    • qualifiers

      String[] qualifiers
      Returns:
      the @Qualifiers value for the feign client. If both qualifier() and qualifiers() are present, we will use the latter, unless the array returned by qualifiers() is empty or only contains null or whitespace values, in which case we'll fall back first to qualifier() and, if that's also not present, to the default = contextId + "FeignClient".
      Default:
      {}
    • url

      String url
      Returns:
      an absolute URL or resolvable hostname (the protocol is optional).
      Default:
      ""
    • decode404

      boolean decode404
      Returns:
      whether 404s should be decoded instead of throwing FeignExceptions
      Default:
      false
    • configuration

      Class<?>[] configuration
      A custom configuration class for the feign client. Can contain override @Bean definition for the pieces that make up the client, for instance Decoder, Encoder, Contract.
      Returns:
      list of configurations for feign client
      See Also:
      Default:
      {}
    • fallback

      Class<?> fallback
      Fallback class for the specified Feign client interface. The fallback class must implement the interface annotated by this annotation and be a valid spring bean.
      Returns:
      fallback class for the specified Feign client interface
      Default:
      void.class
    • fallbackFactory

      Class<?> fallbackFactory
      Define a fallback factory for the specified Feign client interface. The fallback factory must produce instances of fallback classes that implement the interface annotated by FeignClient. The fallback factory must be a valid spring bean.
      Returns:
      fallback factory for the specified Feign client interface
      See Also:
      Default:
      void.class
    • path

      String path
      Returns:
      path prefix to be used by all method-level mappings.
      Default:
      ""
    • primary

      boolean primary
      Returns:
      whether to mark the feign proxy as a primary bean. Defaults to true.
      Default:
      true