zoukankan      html  css  js  c++  java
  • @EnableFeignClients 注解

    feignClents在spring容器里找不到的原因

    • 当使用的feignClents 来自引用别的工程时,需要指定包名,如果不指定就算使用ComponentScan 扫描也不行
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
    import org.springframework.cloud.openfeign.EnableFeignClients;
    import org.springframework.context.annotation.ComponentScan;
    
    /**
     * @describe: 消费者服务启动类
     * @author: zhuchunwang
     * @date: 2019/3/7 16:08
     */
    @SpringBootApplication
    @EnableDiscoveryClient
    /**
     * 如果不写包名默认找启动类包下面的feignClient
     */
    @EnableFeignClients("com.wdcloud.rps.common.*")
    @ComponentScan(basePackages = {"com.wdcloud.rps.common","com.wdcloud.rps.consumer"})
    public class  ConsumerApplication {
    	public static void main(String[] args) {
    		SpringApplication.run(ConsumerApplication.class,args);
    	}
    }
    
    
  • 相关阅读:
    团队博客——1
    团队博客3
    团队博客6
    团队博客2
    团队博客8
    团队博客4
    团队博客7
    安装“消息队列 (MSMQ)”
    服务端上传文件到共享目录
    数据库变成可疑状态
  • 原文地址:https://www.cnblogs.com/zhucww/p/10517089.html
Copyright © 2011-2022 走看看