spring-cloud

Spring Cloud Gateway Oauth2Login Return JWT Token Instead of SESSION Cookie Upon Successful Login

試著忘記壹切 提交于 2021-01-28 10:11:42
问题 sorry in advance if the question is previously asked, but I have not been able to find an answer. I am trying to setup Spring Cloud Gateway to act as a OAuth2 client to authenticate/login users via a Keycloak Authentication server. I have been able to achieve this using the following code snipet: Security Config: @Configuration @EnableWebFluxSecurity @EnableReactiveMethodSecurity public class SecurityConfig { private final GatewayAuthenticationSuccessHandler

Spring Cloud Gateway Oauth2Login Return JWT Token Instead of SESSION Cookie Upon Successful Login

自闭症网瘾萝莉.ら 提交于 2021-01-28 10:04:14
问题 sorry in advance if the question is previously asked, but I have not been able to find an answer. I am trying to setup Spring Cloud Gateway to act as a OAuth2 client to authenticate/login users via a Keycloak Authentication server. I have been able to achieve this using the following code snipet: Security Config: @Configuration @EnableWebFluxSecurity @EnableReactiveMethodSecurity public class SecurityConfig { private final GatewayAuthenticationSuccessHandler

Exception thrown while starting consumer - (Cannot assign same group name for different channels in a microservice )

老子叫甜甜 提交于 2021-01-28 07:52:22
问题 I am a newbie in Spring cloud stream and rabbitmq. Recently I got an Exception after started one of my microservice. It is stating that could not register object because it is already registered, I think it is is because of the group name that assigned for each channel, please check the exception, 2018-05-28 10:01:38.420 ERROR 10244 --- [ask-scheduler-2] o.s.cloud.stream.binding.BindingService : Failed to create consumer binding; retrying in 30 seconds org.springframework.cloud.stream.binder

Spring Cloud Config: client doesn't attempt to connect to the config server

你离开我真会死。 提交于 2021-01-28 05:07:18
问题 I'm trying to create a simple Spring Cloud Config server/client setup and am loosely following the documentation: https://cloud.spring.io/spring-cloud-config/reference/html/ I've so far implemented a server that seems to work correctly, i.e. return the correct property values when I call the corresponding endpoint: GET http://localhost:8888/config-client/development { "name": "config-client", "profiles": [ "development" ], "label": null, "version": null, "state": null, "propertySources": [ {

How to disable hystrix in one of multiple feign clients

江枫思渺然 提交于 2021-01-28 02:50:37
问题 In my spring boot application I use multiple feign clients (@FeignClient("hello-service")). In the case of many of them, I need a mechanism of circuit breaker, so I have following line to the configuration. feign.hystrix.enabled=true However I'don't know how I can configure specific feign client not to use Hystrix. Is it possible? Has anyone managed to configure the spring applications in this way? 回答1: You can create you own configuration with disabled hystrix functionality, and use it for

How to run the app with spring-cloud-starter-aws locally?

一个人想着一个人 提交于 2021-01-28 00:43:07
问题 I need to run Spring Boot based app locally. It uses spring-cloud-starter-aws dependency. The problem is that it tries to connect to EC2 metadata service always. Setting "cloud.aws.*" properties doesn't help. I expect that default AWS credentials chain will be used, credentials and region will be read from one of AWS preferred way (e.g. ~/.aws/config and ~/.aws/credentials files). I tried to set cloud.aws.credentials.useDefaultAwsCredentialsChain property but spring-cloud-starter-aws doesn't

Get request body string from ServerHttpRequest / Flux<DataBuffer>

主宰稳场 提交于 2021-01-27 11:46:05
问题 I am using spring boot version - 2.0.6.RELEASE and spring cloud version - Finchley.SR2 and i have created my custom gateway filter to modify the request body. but while converting the request body to string using Flux i am getting a empty string. i need a method to get the string corresponding to my request body. @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = (ServerHttpRequest) exchange.getRequest(); String s =

Get request body string from ServerHttpRequest / Flux<DataBuffer>

纵饮孤独 提交于 2021-01-27 11:45:27
问题 I am using spring boot version - 2.0.6.RELEASE and spring cloud version - Finchley.SR2 and i have created my custom gateway filter to modify the request body. but while converting the request body to string using Flux i am getting a empty string. i need a method to get the string corresponding to my request body. @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = (ServerHttpRequest) exchange.getRequest(); String s =

Spring cloud gateway gives connection closed prematurely

喜夏-厌秋 提交于 2021-01-27 05:45:10
问题 I am using spring cloud gateway as API gateway in my micro service setup with consul as service discovery. In some case when API of some microservice take more then 2 minutes, gateway throws below error: java.io.IOException: Connection closed prematurely at reactor.ipc.netty.http.client.HttpClientOperations.onInboundClose(HttpClientOperations.java:269) at reactor.ipc.netty.channel.ChannelOperationsHandler.channelInactive(ChannelOperationsHandler.java:113) at io.netty.channel

Spring cloud gateway gives connection closed prematurely

匆匆过客 提交于 2021-01-27 05:44:11
问题 I am using spring cloud gateway as API gateway in my micro service setup with consul as service discovery. In some case when API of some microservice take more then 2 minutes, gateway throws below error: java.io.IOException: Connection closed prematurely at reactor.ipc.netty.http.client.HttpClientOperations.onInboundClose(HttpClientOperations.java:269) at reactor.ipc.netty.channel.ChannelOperationsHandler.channelInactive(ChannelOperationsHandler.java:113) at io.netty.channel