07 2019 档案

摘要:本文分别使用 MongoRepository 和 MongoTemplate 实现 MongoDB 的简单的增删改查 本文使用 docker 安装 MongoDB: 使用示例 application.yml: spring: data: mongodb: uri: mongodb://test:12 阅读全文
posted @ 2019-07-29 22:02 VictorBu 阅读(1032) 评论(0) 推荐(0) 编辑
摘要:本文使用 Sharding-JDBC 实现读写分离,基于 CentOS 7 + MySQL 5.7 一、MySQL 安装及配置 1.1 安装 依次执行命令: sudo wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7- 阅读全文
posted @ 2019-07-26 15:40 VictorBu 阅读(845) 评论(0) 推荐(0) 编辑
摘要:本文分别使用 Elasticsearch Repository 和 ElasticsearchTemplate 实现 Elasticsearch 的简单的增删改查 一、Elastic Stack Elastic Stack 是 ELK Stack 在 5.0 版本加入 Beats 套件后的新称呼 E 阅读全文
posted @ 2019-07-24 15:36 VictorBu 阅读(909) 评论(0) 推荐(0) 编辑
摘要:问题描述 使用 Zuul 作为网关,偶发超时问题及第一次调用触发熔断问题 解决方案 超时问题 ribbon: ReadTimeout: 10000 SocketTimeout: 60000 第一次调用触发熔断 hystrix: command: default: execution: isolati 阅读全文
posted @ 2019-07-15 22:33 VictorBu 阅读(6994) 评论(0) 推荐(0) 编辑
摘要:问题描述 微服务之间使用 Feign 调用,偶发超时问题,配置如下: feign: client: config: default: connectTimeout: 10000 readTimeout: 10000 详细参考官方文档:https://cloud.spring.io/spring-cl 阅读全文
posted @ 2019-07-15 22:23 VictorBu 阅读(4641) 评论(0) 推荐(0) 编辑
摘要:基础知识 虚拟主机 (Virtual Host): 每个 virtual host 拥有自己的 exchanges, queues 等 (类似 MySQL 中的库) 交换器 (Exchange): 生产者产生的消息并不是直接发送给 queue 的,而是要经过 exchange 路由, exchang 阅读全文
posted @ 2019-07-13 17:20 VictorBu 阅读(494) 评论(0) 推荐(0) 编辑
摘要:使用 Spring Boot 开发 API 使用 Spring Security + OAuth2 + JWT 鉴权,已经在 Controller 配置允许跨域: @RestController @CrossOrigin(allowCredentials = "true", allowedHeade 阅读全文
posted @ 2019-07-12 22:08 VictorBu 阅读(5606) 评论(2) 推荐(0) 编辑
摘要:问题描述 微服务中使用 OAuth2 鉴权,直接访问正常,通过 Zuul 访问报错: { "error": "unauthorized", "error_description": "Full authentication is required to access this resource" } 阅读全文
posted @ 2019-07-11 10:29 VictorBu 阅读(5949) 评论(0) 推荐(0) 编辑
摘要:在 Spring Boot 中集成 Swagger 可参考之前的文章:Spring Boot 2 集成 Swagger, 在各个微服务中的配置与之相同;本文仅介绍在 Zuul 中的配置 在 Zuul 项目中添加配置 @Configuration @EnableSwagger2 public clas 阅读全文
posted @ 2019-07-03 18:34 VictorBu 阅读(2310) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示