Spring Cloud – Bootstrapping Version 2
This article is based on https://www.baeldung.com/spring-cloud-bootstrapping. Which was written on January 21, 2021. Even it’s only one year ago it’s a little bit out of dated and there are some errors in the doc.
If you still want to refer to the original doc, here are some corrections you need to do:
- When you setup discovery service, you need to add
server.port=8082
into theapplication.properties
- Also in discovery service, you need to add following dependency otherwise it would report a exception when you start the service: No spring.config.import property has been defined
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
- In Gateway service, the plugin
zuul
has been deprecated already, useSpring Cloud Gateway
instead. (https://stackoverflow.com/questions/65924096/spring-boot-2-4-2-gateway-api-with-zuul)
TODO: new doc. Though it may not be necessary if you can just remember those errors I mentioned above.