上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页
摘要: 问题描述 微服务中使用 OAuth2 鉴权,直接访问正常,通过 Zuul 访问报错: { "error": "unauthorized", "error_description": "Full authentication is required to access this resource" } 阅读全文
posted @ 2019-07-11 10:29 VictorBu 阅读(5821) 评论(0) 推荐(0) 编辑
摘要: 在 Spring Boot 中集成 Swagger 可参考之前的文章:Spring Boot 2 集成 Swagger, 在各个微服务中的配置与之相同;本文仅介绍在 Zuul 中的配置 在 Zuul 项目中添加配置 @Configuration @EnableSwagger2 public clas 阅读全文
posted @ 2019-07-03 18:34 VictorBu 阅读(2292) 评论(0) 推荐(0) 编辑
摘要: 解决方案: 快捷键 Ctrl + Shift + Esc 调出任务管理器 文件 -> 运行新任务 -> 输入:explorer.exe 参考:解决远程桌面连接过去后是蓝色屏幕问题 ​ 解决方案: 参考:解决远程桌面连接过去后是蓝色屏幕问题 ​ 阅读全文
posted @ 2019-06-28 16:25 VictorBu 阅读(658) 评论(0) 推荐(0) 编辑
摘要: 雪花算法根据时间戳生成有序的 64 bit 的 Long 类型的唯一 ID 各 bit 含义: 1 bit: 符号位,0 是正数 1 是负数, ID 为正数,所以恒取 0 41 bit: 时间差,我们可以选择一个参考点,用它来计算与当前时间的时间差 (毫秒数),41 bit 存储时间差,足够使用 6 阅读全文
posted @ 2019-06-28 11:44 VictorBu 阅读(4001) 评论(0) 推荐(0) 编辑
摘要: UUID.randomUUID() 生成的 UUID 是无序的,如果作为数据主键,不利于索引 Hibernate 的 UUIDHexGenerator.generate() 方法可以生成有序的 UUID, 本文参考其实现: public class SequentialUuidHexGenerato 阅读全文
posted @ 2019-06-27 18:02 VictorBu 阅读(4845) 评论(0) 推荐(0) 编辑
摘要: 本文测试代码使用 Spring Boot 2.1.6.RELEASE + Swagger 2.9.2 添加依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <vers 阅读全文
posted @ 2019-06-26 22:38 VictorBu 阅读(1204) 评论(0) 推荐(0) 编辑
摘要: 通过 Spring Security + OAuth2 认证和鉴权,每次请求都需要经过 OAuth Server 验证当前 token 的合法性,并且需要查询该 token 对应的用户权限,在高并发场景下会存在性能瓶颈。使用 JWT 的方式,OAuth Server 只验证一次,用户所有信息 (包括 阅读全文
posted @ 2019-06-23 14:35 VictorBu 阅读(3462) 评论(5) 推荐(0) 编辑
摘要: Spring Security Spring Security 是 Spring Resource 社区的一个安全组件。在安全方面,有两个主要的领域,一是“认证”,即你是谁;二是“授权”,即你拥有什么权限,Spring Security 的主要目标就是在这两个领域 Spring OAuth2 OAu 阅读全文
posted @ 2019-06-22 11:25 VictorBu 阅读(3348) 评论(0) 推荐(0) 编辑
摘要: Spring Boot Admin 用于管理和监控一个或者多个 Spring Boot 程序 新建 spring-boot-admin-server pom <parent> <artifactId>spring-cloud-parent</artifactId> <groupId>com.karo 阅读全文
posted @ 2019-06-16 12:33 VictorBu 阅读(1097) 评论(0) 推荐(0) 编辑
摘要: 微服务架构是一个分布式架构,微服务系统按业务划分服务单元,一个微服务系统往往有很多个服务单元。由于服务单元数量众多,业务的复杂性较高,如果出现了错误和异常,很难去定位。主要体现在一个请求可能需要调用很多个服务,而内部服务的调用复杂性决定了问题难以定位。所以在微服务架构中,必须实现分布式链路追踪,去跟 阅读全文
posted @ 2019-06-15 10:28 VictorBu 阅读(329) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页