spring.application.name=api-gateway
server.port=8765
#unknown property
spring.cloud.gateway.discovery.locator.enabled=true
I tried to downgrade the version of Spring but nothing helps and I also couldn’t find an answer on the Internet
I had the same problem as you, after some research I found that I missed a dependency.
I had in my pom the gateway-mvc, however the property was only correctly identified once I included the gateway dependency, without the "MVC":
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-gateway
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-gateway -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
<version>4.1.4</version>
</dependency>
I had the same problem as you. After checking pom.xml, I found that I added the wrong dependency is:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway-mvc</artifactId>
</dependency>
Instead, try this:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With