title: Injecting feign client
body: <p>I have an error when I inject feignClient interface in my service. This is a spring boot and spring cloud version that I use:</p>
  
  <blockquote>
    <p>org.springframework.boot:spring-boot-starter-parent:2.0.6.RELEASE
    spring cloud version : Finchley.SR2</p>
  </blockquote>
  
  <p>But when I create a feignclient bean in my class service it works.</p>
  
  <p>Create a customer feign client:</p>
  
  <pre><code>@Component("DepartmentClient")
  @FeignClient(name = "DEPARTMENT-SERVICE", url = "http://test")
  public interface DepartmentClient {
  
      @RequestMapping(value = "/department/{departmentId}", method = RequestMethod.GET)
      void findDepartmetById(@PathVariable("departmentId") int departmentId);
  
  }
  </code></pre>
  
  <p>I inject this feign client in the service like </p>
  
  <pre><code>@Service
  public class AgentService {
  
      Logger logger = LoggerFactory.getLogger(AgentService.class);
  
      @Autowired
      private AgentRepository agentRepository;
  
      @Autowired
      private DepartmentClient departmentClient;
  ....
  }
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>Field departmentClient in ...AgentService required a bean of type '...DepartmentClient' that could not be found.
  The injection point has the following annotations:
  org.springframework.beans.factory.annotation.Autowired(required=true)
  Action:
  
  Consider defining a bean of type .... DepartmentClient' in your configuration.
  </code></pre>