• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
毛逢芳
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2020年11月3日
Feign-超时配置
摘要: ribbon: ConnectTimeout: 2000 # 连接超时 ReadTimeout: 5000 # 响应超时 阅读全文
posted @ 2020-11-03 20:09 那棵tree看起来生气了 阅读(90) 评论(0) 推荐(0)
Feign-入门
摘要: 1、启动类添加注解@EnableFeignClients开启feign功能,如果你的 Feign 接口定义跟你的启动类不在同一个包名下,还需要制定扫描的包名 @EnableFeignClients(basePackages=“”), 2、编写feign接口,添加注解@FeignClient并配置va 阅读全文
posted @ 2020-11-03 19:58 那棵tree看起来生气了 阅读(100) 评论(0) 推荐(0)
Intellij idea导入项目时没有目录结构该如何解决?
摘要: 使用ctrl+shift+alt+s打开目录结构,选择module,再选择import module,选择项目的src目录即可 阅读全文
posted @ 2020-11-03 11:28 那棵tree看起来生气了 阅读(222) 评论(0) 推荐(0)
2020年11月2日
Ribbon-负载均衡策略
摘要: 1、‘负载均衡策略种类(默认选择轮询策略) 2、配置负载均衡策略 方法① @Configurationpublic class MyRule { @Bean public IRule rule(){ return new RandomRule(); }} /** * 配置负载均衡策略 * name: 阅读全文
posted @ 2020-11-02 16:19 那棵tree看起来生气了 阅读(67) 评论(0) 推荐(0)
Ribbon-简化RestTemplate调用
摘要: 1、在RestTemplate配置中添加@LoadBalanced注解 @Configurationpublic class RestTemplateConfig { @LoadBalanced @Bean public RestTemplate restTemplate(){ return new 阅读全文
posted @ 2020-11-02 10:31 那棵tree看起来生气了 阅读(80) 评论(0) 推荐(0)
Eureka-高可用
摘要: 搭建俩个EurekaServer:eureka-server-1,eureka-server-2;然后相互注册,并取相同的应用名称 Server1 server: port: 8761eureka: instance: hostname: eureka-server-1 client: servic 阅读全文
posted @ 2020-11-02 10:16 那棵tree看起来生气了 阅读(64) 评论(0) 推荐(0)
2020年10月26日
Eureka-动态获取路径
摘要: 1、在启动类上添加@EnableDiscoveryClient注解 2、注入并调用方法 @Autowiredprivate DiscoveryClient discoveryClient; List<ServiceInstance> instances = discoveryClient.getIn 阅读全文
posted @ 2020-10-26 23:07 那棵tree看起来生气了 阅读(194) 评论(0) 推荐(0)
Eureka-client搭建
摘要: 1、导入坐标<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>2、启动类注 阅读全文
posted @ 2020-10-26 22:41 那棵tree看起来生气了 阅读(177) 评论(0) 推荐(0)
Eureka-server搭建(入门)
摘要: 1、导入坐标<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> <version>Greenwich 阅读全文
posted @ 2020-10-26 21:19 那棵tree看起来生气了 阅读(163) 评论(0) 推荐(0)
2020年10月21日
Eureka-RestTemplate
摘要: RestTemplate是spring提供的简单便捷的模板类,用于在java代码里访问restful服务。 其功能与HttpClient类似,但是RestTemplate实现更加优雅,使用更加方便。 RestTemplate的使用步骤1.定义Bean 编写配置类RestTemplateConfig 阅读全文
posted @ 2020-10-21 16:51 那棵tree看起来生气了 阅读(151) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3