You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/the-discoveryclient-route-definition-locator.adoc
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ You can configure the gateway to create routes based on services registered with
5
5
6
6
By default, the routes created use the protocol `lb://service-name` (where `service-name` is the String that `DiscoveryClient::getServices` will return) and this means that they are load-balanced. For that reason, you also need to include the `org.springframework.cloud:spring-cloud-starter-loadbalancer` dependency, so that it is available on the classpath.
7
7
8
-
To enable this, set `spring.cloud.gateway.discovery.locator.enabled=true` and make sure a `DiscoveryClient` implementation (such as Netflix Eureka, Consul, Zookeeper or Kubernetes) is on the classpath and enabled.
8
+
To enable this, set `spring.cloud.gateway.server.webflux.discovery.locator.enabled=true` and make sure a `DiscoveryClient` implementation (such as Netflix Eureka, Consul, Zookeeper or Kubernetes) is on the classpath and enabled.
== Configuring Predicates and Filters For `DiscoveryClient` Routes
@@ -18,23 +18,23 @@ the ID of the service from the `DiscoveryClient`.
18
18
The default filter is a rewrite path filter with the regex `/serviceId/?(?<remaining>.*)` and the replacement `/$\{remaining}`.
19
19
This strips the service ID from the path before the request is sent downstream.
20
20
21
-
If you want to customize the predicates or filters used by the `DiscoveryClient` routes, set `spring.cloud.gateway.discovery.locator.predicates[x]` and `spring.cloud.gateway.discovery.locator.filters[y]`.
21
+
If you want to customize the predicates or filters used by the `DiscoveryClient` routes, set `spring.cloud.gateway.server.webflux.discovery.locator.predicates[x]` and `spring.cloud.gateway.server.webflux.discovery.locator.filters[y]`.
22
22
When doing so, you need to make sure to include the default predicate and filter shown earlier, if you want to retain that functionality.
23
23
The following examples shows what this looks like in properties and yaml format:
0 commit comments