Skip to content

Commit

Permalink
Merge branch 'spring-cloud:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinnotfound authored Apr 13, 2024
2 parents 160f969 + 66aa480 commit 56a6b68
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

You can configure the gateway to create routes based on services registered with a `DiscoveryClient` compatible service registry.

To enable this, set `spring.cloud.gateway.discovery.locator.enabled=true` and make sure a `DiscoveryClient` implementation (such as Netflix Eureka, Consul, or Zookeeper) is on the classpath and enabled.
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.

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.

[[configuring-predicates-and-filters-for-discoveryclient-routes]]
== Configuring Predicates and Filters For `DiscoveryClient` Routes
Expand Down

0 comments on commit 56a6b68

Please sign in to comment.