![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringCloud
恶狼真菌
这个作者很懒,什么都没留下…
展开
-
SpringCould feign设置接口调用熔断时间
一、feign调用方testA-servicepublic interface TestAService {@RequestMapping(value = “test/handle”, method = RequestMethod.POST)public String handle(@RequestBody TestDTO test);}@FeignClient(name=“testB-service”,fallback = TestFeignFallback.class)public inte原创 2020-07-08 14:48:51 · 2093 阅读 · 0 评论 -
Spring Cloud Admin实现微信监控及邮件提醒
一、创建Spring Cloud Admin项目1.pom文件<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.6.RELEASE</version> <relati原创 2020-06-03 23:10:15 · 1094 阅读 · 0 评论 -
Spring Cloud Gateway实现子项目通过网关统一访问入口
一、要达到的目的我现在有两个业务项目shop-business,shop-user-center,我们用springboot实现后访问的地址大概如下shop-business: http://localhost:8091/shop-business/get/1shop-user-center:http://localhost:8091/shop-user-center/get/1那我们可不可以用网关统一一下访问方式呢?比如:http://localhost:8081/shop-user-cen原创 2020-06-02 15:47:51 · 3867 阅读 · 0 评论 -
Ribbon超时设置
一、简单说一下目前的系统1.注册中心shop-eureka2.网关shop-gateway3.业务系统shop-business4.用户服务shop-user-center二、问题,现在我是在shop-bussiness系统中使用feign调用shop-user-center的接口1.shop-user-center2.shop-business中的feign接口:3.shop-business中的feign接口使用可以看出在图一中我设置sleep时间为7秒,最开始我自己不设置超时时原创 2020-06-01 09:36:06 · 5214 阅读 · 1 评论 -
Hystrix降级时间与ribbon超时时间设置
###一、项目情况1、调用方shop-business的rest接口@ApiOperation(value = "商品详情", httpMethod = "GET")@RequestMapping(value="/get/{id}", method = RequestMethod.GET)public String get(@PathVariable String id) { try { System.out.println(LocalTime.now()+"---AA开始---"+id)原创 2020-06-01 09:28:33 · 659 阅读 · 0 评论 -
Feign调用第三方接口的错误:Method addUser not annotated with HTTP method type (ex. GET, POST)
1.检查降级方法的@PathVariable,其中的(“id”)不能省掉@RequestMapping(value = "/add/{id}", method = RequestMethod.POST)public String addUser(@PathVariable("id") String id);2.检查Fegin配置文件配置文件有没有以下代码,发果有则删除掉,该代码是确定fegin的契约为@RequestLine, 删除后就会使用@RequestMapping 契约 @Bean原创 2020-06-01 09:27:35 · 1174 阅读 · 0 评论 -
Zuul整合Swagger2与swagger-bootstrap-ui
一、项目情况1、Eureka项目:shop-eurake1.1 启动类@SpringBootApplication@EnableEurekaServerpublic class ShopEurekaApplication { public static void main(String[] args) { SpringApplication.run(ShopEurekaApplication.class, args); }}1.2 资源文件server.port=8000spri原创 2020-06-01 09:25:25 · 527 阅读 · 1 评论