
SpringCloud
非ban必选
黑,真他妈的黑
展开
-
使用带有密码的nacos作为Sentinel数据源网关yml配置
nacos中网关的配置如下。原创 2024-11-13 15:52:36 · 151 阅读 · 0 评论 -
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Illegal charac
请求其他微服务时json数据太大被压缩导致的,在配置文件中将该参数调大些即可。springcloud在远程调用其他微服务时报错。该异常是由于Spring Cloud。原创 2023-10-24 12:03:26 · 6489 阅读 · 0 评论 -
springcloud微服务调用报错
的问题是因为聚合层往核心层进行过feign调用时参数过大,经过网络传输到达后端服务时数据丢失导致解析失败。原创 2024-03-29 12:16:56 · 694 阅读 · 0 评论 -
nacos服务对微服务客户端心跳检测原理
NamingProxy 的registerService(String serviceName, String groupName, Instance instance)方法。.NamingProxy 的JsonNode sendBeat(BeatInfo beatInfo, boolean lightBeatEnabled)的方法。com.alibaba.nacos.client.naming.beat.BeatReactor的内部类 BeatTask。微服务向nacos发送心跳请求的配置。原创 2023-01-09 10:29:16 · 325 阅读 · 1 评论 -
SpringCloud网关鉴权请求头中文乱码问题解决
1、鉴权filter2、常量缓存用户信息获取当前用户信息的工具类原创 2022-07-04 10:05:45 · 795 阅读 · 0 评论 -
SpringCloudGateway注册到sentinel-dashboard
1、问题描述使用容器运行网关,容器网络模式使用桥接模式,网关无法注册到sentinel-dashboard上。2、sentinel-dashboard 和客户端默认的通讯端口是8719,可以通过设置参数 spring.cloud.sentinel.transport.port 来修改3、通过设置参数spring.cloud.sentinel.transport.client-ip (此配置的客户端IP将被注册到 Sentinel Server 端) 将该参数设置为网关的ip地址即可。..原创 2022-04-28 13:36:25 · 1693 阅读 · 0 评论 -
从Nacos配置中心读取中文数据乱码
加启动参数java -Dfile.encoding=utf-8 -jar qwe.jar原创 2022-04-08 18:34:40 · 3107 阅读 · 0 评论 -
SpringCloud Feign调用报错feign.RetryableException: too many bytes written executing
因为服务之间调用需要携带一些用户信息之类的 所以实现了Feign的RequestInterceptor拦截器复制请求头,复制的时候是所有头都复制的,可能导致Content-length长度跟body不一致. 所以只需要判断如果是Content-length就跳过原代码package com.pojo.common.core.config;import feign.RequestInterceptor;import org.springframework.context.annot.原创 2022-02-21 15:02:33 · 990 阅读 · 0 评论 -
nacos 配置Sentinel 熔断规则
nacos上网关配置文件 yh-platform-gateway-dev.ymlserver: port: 18600spring: cloud: sentinel: app: #标识网关项目 type: 1 # 取消控制台懒加载 eager: true transport: # 控制台地址 dashboard: 192.168.0.188:8088 # ..原创 2022-02-14 16:29:30 · 1309 阅读 · 0 评论 -
微服务使用seata
接上篇seata-server1.4.2 使用nacos和mysql8_zsj777的专栏-优快云博客system微服务配置bootstrap.yml 配置# Springspring: application: # 应用名称 name: yh-platform-system profiles: # 环境配置 active: dev cloud: nacos: discovery: # 服务注册地址原创 2022-02-10 14:40:33 · 753 阅读 · 0 评论 -
seata-server1.4.2 使用nacos和mysql8
下载地址https://github.com/seata/seata/releases修改seata配置文件registry { # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa type = "nacos" nacos { application = "seata-server" serverAddr = "192.168.0.188:8848" group = "SEATA_GROU.原创 2022-02-10 13:12:10 · 1174 阅读 · 0 评论 -
Springboot-dubbo-fescar 阿里分布式事务
大家可以自行百度下阿里分布式事务,在这里我就不啰嗦了。下面是阿里分布式事务开源框架的一些资料,本文是springboot+dubbo+fescar的集成。快速开始https://github.com/alibaba/fescar/wiki/Quick-StartGIT地址https://github.com/alibaba/fescar1、sqlCREATE TABLE ...原创 2019-01-30 18:07:57 · 2233 阅读 · 2 评论 -
Spring Cloud Feign 调用微服务传递header请求头
FeignConfig配置类package com.pojo.common.core.config;import feign.RequestInterceptor;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.context.request.RequestC原创 2022-02-09 18:15:03 · 851 阅读 · 0 评论 -
springcloud + nacos -- 版本选择
版本说明 · alibaba/spring-cloud-alibaba Wiki · GitHub原创 2022-02-09 10:34:38 · 1028 阅读 · 0 评论 -
springcloud中的超时时间
一、 Feign设置超时时间使用Feign调用接口分两层,ribbon的调用和hystrix的调用,所以ribbon的超时时间和Hystrix的超时时间的结合就是Feign的超时时间#hystrix的超时时间hystrix: command: default: execution: timeout: enabled: true isolation:原创 2021-08-16 21:32:27 · 1095 阅读 · 0 评论 -
Nacos服务注册与服务发现
1、pom添加 <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> <version>1.4.1</version> </dependency>2、注册服务代码package com.corundumst原创 2021-04-18 21:19:16 · 533 阅读 · 0 评论 -
springcloud stream rabbitmq延时消息发送javabean对象
1、参考https://blog.youkuaiyun.com/zsj777/article/details/1154747092、配置文件添加spring.cloud.stream.bindings.example-topic-output.content-type=application/json3、实体类package com.example.demo.controller;import java.io.Serializable;public class FaceRabbitA原创 2021-04-07 01:17:16 · 168 阅读 · 1 评论 -
springcloud stream rabbitmq延时消息
1、pom文件添加 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-stream-binder-rabbit</artifactId> </dependency> <dependency> &原创 2021-04-07 00:17:24 · 239 阅读 · 1 评论 -
springcloud gateway整合 sentinel nacos
1、网关工程pom文件添加以下依赖 <!-- SpringCloud Gateway --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> </dependenc原创 2021-04-01 18:43:56 · 340 阅读 · 0 评论 -
springcloud使用redisson-spring-boot-starter从nacos配置中心获取redis配置
1、pom文件添加 <dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.15.1</version> </dependency>2、na原创 2021-03-23 20:11:45 · 4009 阅读 · 0 评论 -
SpringCloudAlibaba集成zipkin和seata的时候远程调用服务连接不上的问题
1、报错如下问题: 在使用seata,使用spring-cloud-alibaba-seata和spring-cloud-starter-sleuth两个maven依赖时,在接口调用的时候,会报错:Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: 192.168.4.15 at com.netflix.loadbalan...原创 2020-07-03 17:31:02 · 1306 阅读 · 0 评论 -
SpringCloud 使用consul作为微服务注册中心
eureka宣布闭源,使用consul作为服务注册中心。1、parent 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-i...原创 2018-12-22 16:49:55 · 742 阅读 · 0 评论 -
linux安装consul集群
一、集群规划consul借助agent来运行,类似elk的logstash agent 或 zabbix监控系统的agent ,每个需要被发现的服务上,通过consul agent client 来收集服务本身的信息,然后向consul agent server汇报, consul server 可以集群部署。规划一下:序号 节点ip 节点名称 角色 1...原创 2018-12-22 16:46:04 · 938 阅读 · 0 评论 -
windows下安装consul
由于Eureka宣布闭源,选择consul作为微服务注册中心。consul下载地址https://www.consul.io/downloads.html下载完成后解压,在配置环境变量,计算机 右键 属性 高级属性设置环境变量设置 在path下加上consul的路径。cmd启动:consul agent -dev 启动成功打开网址:http://loc...原创 2018-12-22 16:38:04 · 322 阅读 · 1 评论