spring-cloud-gateway

How to configure netty connection-timeout for Spring WebFlux

流过昼夜 提交于 2020-05-15 05:45:10
问题 I am running spring cloud gateway (which I understand to be built on Spring Webflux) behind an AWS loadbalancer and I am receiving intermittent 502 errors. Upon investigation, it appears the issue has to do with connection timeouts between the loadbalancer and my nodes. From some investigation it appears that the underlying netty server has a default timeout of 10 seconds. I determined this using the following command... time nc -vv 10.10.xx.xxx 5100 Connection to 10.10.xx.xxx 5100 port [tcp/

Specifying route URI in Spring Cloud Gateway Configuration

自古美人都是妖i 提交于 2020-05-14 02:48:31
问题 Here is the yml for spring cloud gateway. I want to write URI without load balancing. But as I'm using Eureka, I don't think hardcoding something like "localhost:6678" is a good idea. I would like to specify the service name, without the lb prefix. Any way to write it ? spring: cloud: gateway: routes: - id: before_route uri: lb://hello-service I'm seeing this on the console when I run the gateway: You already have RibbonLoadBalancerClient on your classpath. It will be used by default. As

Specifying route URI in Spring Cloud Gateway Configuration

╄→尐↘猪︶ㄣ 提交于 2020-05-14 02:44:48
问题 Here is the yml for spring cloud gateway. I want to write URI without load balancing. But as I'm using Eureka, I don't think hardcoding something like "localhost:6678" is a good idea. I would like to specify the service name, without the lb prefix. Any way to write it ? spring: cloud: gateway: routes: - id: before_route uri: lb://hello-service I'm seeing this on the console when I run the gateway: You already have RibbonLoadBalancerClient on your classpath. It will be used by default. As

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

僤鯓⒐⒋嵵緔 提交于 2020-04-30 05:48:07
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

北城以北 提交于 2020-04-30 05:48:05
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

How to “remove the gobal prefix('/api') then goto the lb:// ” when migrate to spring cloud gateway from zuul

隐身守侯 提交于 2020-03-18 10:16:15
问题 I want to Migrating from zuul to spring cloud gateway, I don't want to change my config of previous app. I want to know how to handle with the url with "/api/ + 'serviceId'", route to lb://serviceId the previous zuul config zuul: prefix: /api there are lots of service regist to eureka ,i don't want to config a route for each one. eg. the auto generated route by org.springframework.cloud.gateway.discovery.DiscoveryClientRouteDefinitionLocator { "route_id": "CompositeDiscoveryClient_APIGATEWAY"

Spring Cloud Gateway and TokenRelay Filter

微笑、不失礼 提交于 2020-03-05 01:29:18
问题 I’m trying to migrate JHipster from using Zuul to Spring Cloud Gateway. JHipster uses Eureka to look up routes and I believe I’ve configured Spring Cloud Gateway correctly to look up routes and propagate the access token to them. Here’s my config: spring: cloud: gateway: default-filters: - TokenRelay discovery: locator: enabled: true lower-case-service-id: true route-id-prefix: /services/ httpclient: pool: max-connections: 1000 The problem I’m experiencing is the access token is not sending

Create route in Spring Cloud Gateway with OAuth2 Resource Owner Password grant type

只谈情不闲聊 提交于 2020-02-15 20:12:32
问题 How to configure a route in Spring Cloud Gateway to use an OAuth2 client with authorization-grant-type: password ? In other words, how to add the Authorization header with the token in the requests to an API? Because I'm integrating with a legacy application, I must use the grant type password. I have this application: @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } @Bean public RouteLocator

Create route in Spring Cloud Gateway with OAuth2 Resource Owner Password grant type

倾然丶 夕夏残阳落幕 提交于 2020-02-15 20:08:15
问题 How to configure a route in Spring Cloud Gateway to use an OAuth2 client with authorization-grant-type: password ? In other words, how to add the Authorization header with the token in the requests to an API? Because I'm integrating with a legacy application, I must use the grant type password. I have this application: @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } @Bean public RouteLocator

Create route in Spring Cloud Gateway with OAuth2 Resource Owner Password grant type

旧城冷巷雨未停 提交于 2020-02-15 20:05:03
问题 How to configure a route in Spring Cloud Gateway to use an OAuth2 client with authorization-grant-type: password ? In other words, how to add the Authorization header with the token in the requests to an API? Because I'm integrating with a legacy application, I must use the grant type password. I have this application: @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } @Bean public RouteLocator