
SpringCloud
文章平均质量分 57
SpringCloud相关
oJueQiang123456
这个作者很懒,什么都没留下…
展开
-
Dubbo + Sleuth + Zipkin 链路追踪
一、简介1、默认情况下,Spring Cloud Sleuth支持服务之间http请求的traceId的传递。如最为常见的Feign和RestTemplate等。不支持服务在dubbo调用之间传递,所以我们要扩展dubbo的Filter。2、使用brave-instrumentation-dubbo-rpc组件来扩展dubbo的Fiter。二、Zipkin安装1、下载:zipkin-server-2.12.9-exec.jar2、启动:start.sh,访问地址:http://local原创 2021-10-26 00:17:57 · 879 阅读 · 0 评论 -
Sentinel @SentinelResource注解非接口方法限流和降级
一、Controller@RestController@RequestMapping("/test/")public class TestController { @Autowired private TestService testService; @RequestMapping("test") public String test() { String str = testService.findByName("test");原创 2021-09-05 00:10:12 · 530 阅读 · 0 评论 -
Sentinel 使用Nacos存储规则
一、pom<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId></dependency><dependency> <groupId>com.alibaba.csp</groupId> <原创 2021-09-01 23:42:25 · 678 阅读 · 0 评论 -
Sentinel 限流
一、安装客户端:1.6.0版本1、下载地址 sentinel-dashboard-1.6.0.jar2、 启动java -Dserver.port=8888 -Dsentinel.dashboard.auth.username=sentinel -Dsentinel.dashboard.auth.password=123456 -Dserver.servlet.session.timeout=7200 -jar sentinel-dashboard-1.6.0.jar-Dsentinel.原创 2021-08-31 23:35:04 · 293 阅读 · 0 评论 -
Nacos 多环境配置
目录结构一、pom中添加包<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0..原创 2021-08-22 22:44:34 · 1377 阅读 · 0 评论 -
SpringCloud Alibaba + Dubbo 常见设置
一、自定义异常:dubbo在抛出非Exception异常时会进行一次封装,所在在跨服务调用时,账户服务如果抛出自定义异常,订单服务无法直接获取到账户服务抛出的自定义异常信息。所以可以在被调用服务的接口声明自定义异常,dubbo则不会对异常进行封装如:public interface AccountService { public void insert(Account account) throws APIException; /** * 扣减余额 * @par原创 2021-03-19 10:04:39 · 315 阅读 · 0 评论 -
SpringCloud Alibaba + Dubbo + Nacos + Seata - 案例代码
一、pom1、父工程pom<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.原创 2021-03-15 00:21:47 · 179 阅读 · 0 评论 -
SpringCloud Alibaba + Dubbo + Nacos + Seata - 环境部署
一、版本SpringBoot(2.1.6.RELEASE),SpringCloud(Greenwich.SR2),SpringCloudAlibaba(2.1.3.RELEASE),Nacos(1.2.1),Seata(1.2.0)二、环境搭建1、nacos安装下载解压安装:https://github.com/alibaba/nacos/releases运行:./bin/startup.sh -m standalone &访问:http://localhost:8848/n原创 2021-03-15 00:05:47 · 496 阅读 · 0 评论