大漠知秋的加油站

  • 首页
大漠知秋的加油站
你就当我的烂笔头吧
Spring Cloud Finchley.RELEASE

Config Server 安全

引入依赖 <!-- 安全 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> 增加配置 spring: # 开启安全控制 security: user: # 用户名 name: config-server # 密码 passwor…

2019年1月3日 0条评论 886点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Config Server refresh 端点

refresh 引入依赖 <!-- 内省 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 打开端点 ### 端点控制 management: endpoints: web: exposure: # 开启指定端点、所有端点 in…

2019年1月3日 0条评论 873点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Config Server 入门

简介   Spring Cloud Config 是一个集中化外部配置的分布式系统,由服务端和客户端组成。它不依赖于注册中心,是一个独立的配置中心。Spring Cloud Config 支持多种存储配置信息的形式,目前主要有 jdbc、Vault、Native、Svn、Git,其中默认为 Git。 入门 服务端 Git 版 新建项目 引入依赖 <!-- Spring Cloud Config Server --> <dependency> <groupId>org.spring…

2019年1月3日 0条评论 996点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Zuul serviceId 映射与 url 映射超时配置的不同

使用 serviceId 时配置超时: ### Ribbon 配置 ribbon: # http建立socket超时时间,毫秒 ConnectTimeout: 2000 # http读取响应socket超时时间 ReadTimeout: 8000 使用 url 时配置超时: ### 网关配置 zuul: host: # 连接超时 connect-timeout-millis: 2000 # 响应超时 socket-timeout-millis: 8000

2019年1月3日 0条评论 865点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Zuul 对 Hystrix 的线程隔离模式选择

  Hystrix 的线程隔离模式包括 线程池隔离模式(THREAD)和信号量隔离模式(SEMAPHORE)。针对这两种模式的说明和特定场景下的选择如下: | | 线程池模式(THREAD) | 信号量模式(SEMAPHORE) | | --- | --- | --- | | 官方推荐 | 是 | 否 | | 线程 | 与请求线程分离 | 与请求线程共用 | | 开销 | 上下文切换频繁,较大 | 较小 | | 异步 | 支持 | 不支持 | | 应对并发量 | 大 | 小 | | 适用场景 | 外网交互 | 内网…

2019年1月3日 0条评论 1090点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

使用 Undertow 替换掉 Tomcat

  官方说:For servlet stack applications, the spring-boot-starter-web includes Tomcat by including spring-boot-starter-tomcat, but you can use spring-boot-starter-jetty or spring-boot-starter-undertow instead   When switching to a different HTTP server, you need t…

2019年1月3日 0条评论 1294点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

OpenResty + Lua 动态增加 Zuul 节点

隐忧   在 Spring Cloud 微服务架构体系中,所有请求的前门的网关 Zuul 承担着请求转发的主要功能,对后端服务起着举足轻重的作用。当业务体量猛增之后得益于 Spring Cloud 的横向扩展能力,往往加节点、加机器就可以使得系统支撑性获得大大提升,但是仅仅加服务而不加网关是会有性能瓶颈的,实践经验得出的结论是单一 Zuul 的处理能力十分有限,因此扩张节点往往是服务连带 Zuul 一起扩张,然后再在请求上层加一层软负载,通常是使用 Nginx(Nginx 均分请求到 Zuul 负载层,“完美”地解…

2019年1月3日 0条评论 1072点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Zuul 添加 Header

  在网关层添加新的 Header 信息是很常见的,比如天剑唯一id、时间戳等。   如下伪代码添加 Header 头: @Component @Slf4j public class ModifyHeaderFilter extends ZuulFilter { ...... @Override public Object run() throws ZuulException { RequestContext ctx = RequestContext.getCurrentContext(); ctx.addZuul…

2019年1月3日 0条评论 844点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Zuul 使用 OKHttp 替换 HttpClient

引入依赖 <!-- OKHttp 支持 --> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> </dependency> 开启 OKHttp 支持 ### Ribbon 配置 ribbon: httpclient: # 关闭 httpclient 支持 enabled: false okhttp: # 开启 o…

2019年1月3日 0条评论 812点热度 0人点赞 大漠知秋 阅读全文
Spring Cloud Finchley.RELEASE

Zuul 修改请求体内容

样例代码: /** * @Author:大漠知秋 * @Description:修改请求体内容 * @CreateDate:4:35 PM 2018/10/31 */ @Component @Slf4j public class ModifyRequestEntityFilter extends ZuulFilter { @Override public String filterType() { return PRE_TYPE; } @Override public int filterOrder() { ret…

2019年1月3日 0条评论 792点热度 0人点赞 大漠知秋 阅读全文
1…1415161718…24
分类
  • C++ / 11篇
  • Develop Software / 3篇
  • Docker CE / 24篇
  • Elasticsearch / 3篇
  • FastDFS / 1篇
  • Flutter / 1篇
  • Git / 3篇
  • GitLab / 6篇
  • Golang / 21篇
  • Http Client 4.5.2 / 2篇
  • Java / 14篇
  • Kubernetes / 19篇
  • Linux / 65篇
  • Mac / 5篇
  • Maven / 1篇
  • MyBatis / 1篇
  • MySQL / 8篇
  • Nginx / 6篇
  • Rabbit MQ / 10篇
  • Redis / 1篇
  • Spring / 1篇
  • Spring Boot / 12篇
  • Spring Cloud Finchley.RELEASE / 50篇
  • Sublime / 2篇
  • Windows / 1篇
  • 吉他 / 2篇
  • 图论 / 8篇
  • 数据结构与算法 / 11篇
  • 未分类 / 1篇

COPYRIGHT © 2023 大漠知秋的加油站. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备16029200号-2