文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】- 20使用@RefreshScope实现配置的刷新

概述Spring Cloud实战-06使用/actuator/bus-refresh端点手动刷新配置 + 使用Spring Cloud Bus自动更新配置 中说到了@RefreshScope实现配置刷新,这里我们来通过一个例子再来感受下。4个微服务工程:Eureka Server : https://github.com/yangshangwei/springcloud-o2o/tree/mas....

Spring Cloud【Finchley】- 20使用@RefreshScope实现配置的刷新
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-18 Zuul过滤器

概述前面几篇博文,我们梳理了zuul的基本使用、路由及容错.我们知道,zuul包含了对请求的路由和过滤两个功能,路由功能负责将外部请求转发到具体的微服务实例上,是实现外部访问统一入口的基础过滤器功能则负责对请求的处理过程进行干预,是实现请求校验、服务聚合等功能的基础每一个进入Zuul的HTTP请求都会经过一系列的过滤器处理链得到请求响应并返回给客户端。Spring Cloud官网中的介绍比较少 ....

Spring Cloud【Finchley】-18 Zuul过滤器
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-16 Zuul的路由配置

概述Spring Cloud【Finchley】-14 微服务网关Zuul的搭建与使用中我们搭建了zuul的微服务,对所有注册在Eureka Server上的服务进行了代理。 当然了,zuul也支持更加细粒度的支持,比如对某些特定的微服务,或者特定的URL等,这里我们继续来学习下zuul更加丰富的路由配置。官方指导: https://cloud.spring.io/spring-cloud-st....

Spring Cloud【Finchley】-16 Zuul的路由配置
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-15 查看Zuul的路由端点和过滤器

概述官网: https://cloud.spring.io/spring-cloud-static/Finchley.SR2/single/spring-cloud.html#_management_endpoints确认spring-boot-starter-actuator依赖默认情况下,我们引入的spring-cloud-starter-netflix-zuul依赖会自动的引入spring....

Spring Cloud【Finchley】-15 查看Zuul的路由端点和过滤器
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-11Feign项目整合Hystrix监控

概述我们前面的文章 Spring Cloud【Finchley】-09Feign使用Hystrix 中介绍了,如何在使用Feign的项目中使用Hystrix, 现在来探讨下如何在使用Feign的项目中监控Hystrix.整合步骤我们知道Hystrix的hystrix-metrics-event-stream模块 将监控信息以text/event-stream的格式暴露给外部系统。根据spring....

Spring Cloud【Finchley】-11Feign项目整合Hystrix监控
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-10Hystrix监控

概述Hystrix除了提供容错外,还提供了功能近乎实时的监控。HystrixCommand和HystrixObservableCommand在执行时,会生成执行结果和运行指标。监控HystrixHystrix的hystrix-metrics-event-stream模块 将监控信息以text/event-stream的格式暴露给外部系统。添加 spring-cloud-starter-netfl....

Spring Cloud【Finchley】-10Hystrix监控
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-09Feign使用Hystrix

版本说明先说下使用的spring cloud和spring boot的版本Disable HystrixCommands For FeignClients By Defaulthttps://github.com/spring-cloud/spring-cloud-netflix/issues/1277新建子module父工程microservice-spring-cloud右键新建Maven ....

Spring Cloud【Finchley】-09Feign使用Hystrix
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-08使用Hystrix实现容错

概述前面的几篇博文,我们接触到了Eureka实现服务的注册于发现、Ribbon实现客户端负载均衡、Feign实现声明式的API调用,谈到微服务,容错也是不得不提的话题之一。Soring Cloud 集成了Hystrix来提供容错的能力,从而实现微服务的容错。实现容错主要方式假设服务提供者的响应很慢,那么消费者的请求将会被强制等待,直到响应或者超时。 在高负载的情况下,很有可能发生的情况是,当依赖....

Spring Cloud【Finchley】-08使用Hystrix实现容错
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-07Feign构造多参数GET/POST请求

概述Spring Cloud-06服务消费者整合Feign中将消费者和Feign整合在了一起,示例中Feign客户端接口中的参数只有1个,如下实际开发中,多个请求非常常见,如果请求参数有多个呢? 我们使用Feign该如何调用请求呢?调用顺序当浏览器或者外部其他请求请求到MovieController,MovieController需要调用UserController服务提供者提供的服务,Movi....

Spring Cloud【Finchley】-07Feign构造多参数GET/POST请求
文章 2023-05-26 来自:开发者社区

Spring Cloud【Finchley】-06服务消费者整合Feign

概述回想下我们在使用Eureka 和 Ribbon的时候是怎么调用注册在Eureka Server上的微服务的地址呢?可以看到其实是通过拼接的方式,当然了我们上面的这个例子只有一个参数 id,看起来没有这麻烦。设想下如果有多个参数呢?假设URL如下http://localhost:8080/search?name=小工匠&age=20&username=artisan那我们用Re....

Spring Cloud【Finchley】-06服务消费者整合Feign

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

微服务

构建可靠、高效、易扩展的技术基石

+关注