spring-cloud-gateway

Consul with Spring Cloud Gateway - Inter Service Communication

时光总嘲笑我的痴心妄想 提交于 2020-02-07 06:01:27
问题 The setup: I have a set of Spring Boot based microservices that are fronted by Spring Cloud Gateway, meaning every request that comes from UI or external API client first comes to Spring Cloud Gateway and is then forwarded to appropriate microservice. The routes are configured in Consul, and Spring Cloud Gateway communicates with Consul to get the routes accordingly. Requirement: There is a need of some microservices communicating with each other with REST APIs. I would prefer this

Deny access to one particular subpath for spring cloud gateway route

北慕城南 提交于 2019-12-23 05:01:24
问题 We're using Spring Cloud Gateway in front of our backend services. We have a route similar to the following: routes: - id: foobar-service uri: lb://foobar-service predicates: - Path=/foobar/** filters: - StripPrefix=1 We want to deny access to one particular subpath (e.g. /foobar/baz/** ) but leave the rest open. Is it possible to do this using the YAML syntax? Perhaps we need to implement the routes using the Fluent API instead? 回答1: routes: - id: foobar-baz-service uri: no://op predicates:

How to set up Spring Cloud Gateway application so it can use the Service Discovery of Spring Cloud Kubernetes?

99封情书 提交于 2019-12-21 23:37:26
问题 I created two Spring Boot applications which both will be deployed in a Kubernetes cluster. One of those apps will act as a gateway and therefore uses Spring Cloud Gateway as a dependency. Also I want to integrate service discovery with Spring Cloud Kubernetes and that the gateway uses the service discovery to automatically generate corresponding routes. But when I expose the gateway application, which is running in an local Minikube cluster, and invoke the second app/service I get a 503

How to deploy Spring Cloud Gateway 2.1 on Jboss or Tomcat?

…衆ロ難τιáo~ 提交于 2019-12-13 03:06:02
问题 I want to a deploy Spring Cloud Gateway but it is built on Spring Framework 5, Project Reactor. Can I create a WAR file and deploy it on a traditional application server such as Jboss or Tomcat. The Spring documentation in this page says it is possible. Spring WebFlux is supported on Tomcat, Jetty, Servlet 3.1+ containers Note: this is Spring Cloud Gateway project link https://spring.io/projects/spring-cloud-gateway 回答1: I don't think this is possible, as Spring Cloud Gateway is itself a

Rate limiting based on user plan in Spring Cloud Gateway

醉酒当歌 提交于 2019-12-12 13:38:29
问题 Say my users subscribe to a plan. Is it possible then using Spring Cloud Gateway to rate limit user requests based up on the subscription plan? Given there're Silver and Gold plans, would it let Silver subscriptions to have replenishRate/burstCapacity of 5/10 and Gold 50/100? I naively thought of passing a new instance of RedisRateLimiter (see below I construct a new one with 5/10 settings) to the filter but I needed to get the information about the user from the request somehow in order to

Spring Cloud Gateway auto routing to Eureka services

两盒软妹~` 提交于 2019-12-11 16:56:13
问题 I work with Spring to create microservices. I am using Eureka for service discovery and Zuul for routing. Now I wanted to switch to Spring Cloud Gateway (because of non-blocking nature) but I've failed to figure out a way of auto routing to each Eureka service. For example if one service 'eureka-client' registers to Eureka, Zuul does provide a path like localhost:8762/eureka-client to this service by itself. With Spring Cloud Gateway, I've to create a route all by myself for each service.

Spring Cloud Kubernetes + Spring Cloud Gateway: Unable to find instance for k8s service

 ̄綄美尐妖づ 提交于 2019-12-11 15:54:34
问题 I am using Spring Cloud Kubernetes + Spring Cloud Gateway(SCG) and I have some trouble to deploy my app on GKE. SCG does not find k8s service, I still get this error: There was an unexpected error (type=Service Unavailable, status=503). Unable to find instance for uiservice uiservice is Angular app. When I take a look at .../actuator/gateway/routes I have this result: [ { "route_id": "CompositeDiscoveryClient_gateway", "route_definition": { "id": "CompositeDiscoveryClient_gateway",

use spring cloud gateway with oauth2

我是研究僧i 提交于 2019-12-09 02:49:38
问题 i face a problem when i using spring cloud gateway is if any dependency call spring-boot-starter-tomcat directly or recursively it will not work because it will start the embedded tomcat server not the netty server that spring cloud gateway use i started to solve this problem by excluding this dependency <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> the spring cloud gateway worked

Simple Gateway Using Spring Cloud Gateway - ProxyExchange

心已入冬 提交于 2019-12-05 02:59:30
问题 I wanted to write a simple gateway using spring cloud, so that requests to a third party would appear to come from my service (as I have done so in the past with Zuul). The example on the github page and likewise in the official docs seems to be exactly what I want. i.e. a simple controller route to proxy all requests to a given route: @GetMapping("/proxy/path/**") public ResponseEntity<?> proxyPath(ProxyExchange<?> proxy) throws Exception { String path = proxy.path("/proxy/path/"); return