spring-cloud

Spring Security with OAuth2 and JWT: Encoded password does not look like BCrypt

北战南征 提交于 2019-11-29 12:06:43
问题 I am trying to implement a spring AuthorizationServer with JWT. I was able to produce JWT tokens and login until I added BCrypt to the mix. Now, when I am trying to login, I get "Bad credentials" from the API. OAuth2Configuration.java @Configuration @EnableAuthorizationServer public class OAuth2Configuration extends AuthorizationServerConfigurerAdapter { private DataSource dataSource; private AuthenticationManager authenticationManager; private BCryptPasswordEncoder passwordEncoder; public

Combination of Spring Cloud and Orchestration Tools Like Docker Swarm and Kubernetes

帅比萌擦擦* 提交于 2019-11-29 08:48:51
I have a cloud-native application, which is implemented using Spring Cloud Netflix . So, in my application, I'm using Eureka service discovery to manage all instances of different services of the application. When each service instance wants to talk to another one, it uses Eureka to fetch the required information about the target service (IP and port for example). The service orchestration can also be achieved using tools like Docker Swarm and Kubernetes , and it looks there are some overlaps between what Eureka does and what Docker Swarm and Kubernetes can do. For example, Imagine I create a

Spring Cloud Gateway 之Predict篇

↘锁芯ラ 提交于 2019-11-29 06:05:25
https://blog.csdn.net/forezp/article/details/84926662 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接: https://blog.csdn.net/forezp/article/details/84926662 转载请标明出处: http://blog.csdn.net/forezp/article/details/84926662 本文出自 方志朋的博客 Spring Cloud gateway工作流程 在之前的文章的Spring Cloud Gateway初体验中,大家已经对Spring Cloud Gateway的功能有一个初步的认识,网关作为一个系统的流量的入口,有着举足轻重的作用,通常的作用如下: 协议转换,路由转发 流量聚合,对流量进行监控,日志输出 作为整个系统的前端工程,对流量进行控制,有限流的作用 作为系统的前端边界,外部流量只能通过网关才能访问系统 可以在网关层做权限的判断 可以在网关层做缓存 Spring Cloud Gateway作为Spring Cloud框架的第二代网关,在功能上要比Zuul更加的强大,性能也更好。随着Spring Cloud的版本迭代,Spring Cloud官方有打算弃用Zuul的意思。在笔者调用了Spring

Properties versioning with Spring Cloud Config

余生颓废 提交于 2019-11-29 03:26:20
问题 I am probably missing something here, but what is a good solution for properties versioning? For example, in a blue-green deployment scenario with property value changes (old app version consumes the old value, new version requires the new value), how do you ensure both versions of your app can successfully co-exist (considering potential restarts and rollbacks)? One option would be to create new property names for the properties that need new values applied. This, of course, is not a good

Get failure exception in @HystrixCommand fallback method

狂风中的少年 提交于 2019-11-29 02:57:11
问题 Is there a way to get the reason a HystrixCommand failed when using the @HystrixCommand annotation within a Spring Boot application? It looks like if you implement your own HystrixCommand , you have access to the getFailedExecutionException but how can you get access to this when using the annotation? I would like to be able to do different things in the fallback method based on the type of exception that occurred. Is this possible? I saw a note about HystrixRequestContext.initializeContext()

actuator /refresh is not being provided in SpringBoot 2.0.1

放肆的年华 提交于 2019-11-29 02:34:56
I am creating a demo project for Spring-Config-Server and Spring-Config-Client . In SpringBoot 1.5.6.RELEASE everything is working fine. However, when I am upgrading project to 2.0.1.RELEASE it does not provide the actuator endpoints. Actuator endpoint provided in 1.5.6.RELEASE Mapped "{[/refresh || /refresh.json],methods=[POST]}" Mapped "{[/dump || /dump.json],methods=[GET] Mapped "{[/heapdump || /heapdump.json],methods=[GET] Mapped "{[/autoconfig || /autoconfig.json],methods=[GET] Mapped "{[/resume || /resume.json],methods=[POST]}" Mapped "{[/configprops || /configprops.json],methods=[GET]

Eureka peers not synchronized

亡梦爱人 提交于 2019-11-29 02:33:37
I'm prototyping a set of Spring Cloud + Netflix OSS applications and have run into trouble with Eureka. In our setup, we have a Spring Cloud Config Server + Eureka Server, and then 2 modules that utilize that server component for bootstrapping and service discovery. The problem I run into is that if I spin up 2 instances of the Eureka Server and try to pair them (based on the Two Peer Aware Eureka Servers in the docs ) they don't synchronize with each other. See configs below and/or the code on GitHub . Essentially, Peer1 starts up and looks fine. Peer2 will startup and look fine, with both

HATEOAS paths are invalid when using an API Gateway in a Spring Boot app

给你一囗甜甜゛ 提交于 2019-11-29 02:16:55
I have two spring boot applications where one of them is acting as an API Gateway (as discussed here Spring Example ). The other which is wired into the first one is exposing a profile service using spring-data-rest (spring-data-neo4j-rest). The first application is starting on port 8080 and is using zuul to route requests to the second as follows: zuul: routes: profiles: path: /profiles/** url: http://localhost:8083/profiles/ This all works fine and requests to http://localhost:8080/profiles are being served from the second app. The problem though is that the HATEOAS links in the response are

Error Injecting FeignClient from another Project

空扰寡人 提交于 2019-11-29 02:04:30
问题 I am having trouble auto wiring a feign client from another project. It appears that the implementation of the feign client is not being generated and injected. This is the error I am getting. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'passportRestController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.wstrater.service.contacts.client

SpringCloud 基础

北城余情 提交于 2019-11-29 01:59:30
目录 SpringCloud 基础 一、概述 二、服务发现组件 Eureka 1. 介绍 2. 搭建 Maven 父工程 3. 创建 Eureka 集群 4. 创建服务提供方集群 5. 创建服务消费方 三、服务调用组件 1. 调用服务基于 LoadBalancerClient 2. 调度服务基于 Ribbon 3. 调度基于 Feign 四、熔断器组件 Hystrix 1. 介绍 2. Ribbon使用Hystrix 3. Feign使用Hystrix 4. Hystrix监控服务器 五、分布式配置中心组件Spring Cloud Config 1. 介绍 2. 构建Config Server 3. 构建Config Client 六、服务网关组件Netflix Zuul 1. 介绍 2.Zuul服务网关搭建 SpringCloud 基础 一、概述 微服务:将传统的一站式应用,拆分成一个个的服务,彻底去耦合,一个微服务就是单功能业务,只做一件事。 微服务是一种架构模式或者一种架构风格,提倡将单一应用程序划分成一组小的服务独立部署服务之间相互配合、相互协调,每个服务运行于自己的进程中。服务与服务间采用轻量级通讯,如HTTP的RESTful API等避免统一的、集中式的服务管理机制 。 微服务优点 每个服务足够内聚,足够小,比较容易聚焦。 开发简单且效率高,一个服务只做一件事情。