Describe the bug According to docs: https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/

spring-cloud-starter-openfeign supports spring-cloud-starter-loadbalancer. However, as is an optional dependency, you need to make sure it been added to your project if you want to use it.

Sample But in my example, where i dont have spring-cloud-starter-loadbalancer i got message:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sap.fsm.poc.infrastructure.api.FeignDataService': Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?
Caused by: java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?

the service:

@FeignClient("data-service")
public interface FeignDataService extends DataService {

    @Override
    @GetMapping(path = "/status")
    String getCloudStatusPage();
}

so is it optional? shall i disable it somehow? why it cries for loadbalancer if docs states it is optional? should the app crash or rather print info?

or am i doing smth wrong?

my usecase is i use the http://data-service/status requests inside k8s cluster, so i dont want to specify url, but simply relay on k8s service load balancing (K8S Service object) so i always want to sent requests to http://data-service/status

Comment From: OlgaMaciaszek

Hello @sta-szek . It is, in fact, optional. The issue is the way you configure your Feign client. The way it is, in the snippet, it will treat data-service as a service id for load-balancing, hence it will expect a LoadBalancer implementation to be present. In order to make it work without load-balancing, specify your service URL using the url field in the @FeignClient annotation. You can read more in the docs.