How can spring boot be upgraded to spring cloud?
It is believed that many inexperienced people have no idea about how to upgrade spring boot to spring cloud. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
1. Upgrade spring boot version to 2.1.3 first
Org.springframework.boot spring-boot-starter-parent 2.1.3.RELEASE
If you are upgrading from a version below 2.0.0, please pay attention to the redis configuration spring.redis.jedis.* after upgrading to 2.1.3
# redis configuration spring.redis.database = 15spring.redis.host = 10.10.216.203spring.redis.port = 6379spring.redis.password = Redis@123spring.redis.ssl = falsespring.redis.jedis.pool.max-active = 10spring.redis.jedis.pool.max-idle = 10spring.redis.jedis.pool.min-idle = 5
2. Inherit spring cloud-related dependencies
Org.springframework.boot spring-boot-starter-parent 2.1.3.RELEASE org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import
3. If you access the registry, increase the dependence on consul
Org.springframework.cloud spring-cloud-starter-consul-discovery
Add the relevant configuration required by the registry in application.properties:
Spring.application.name = the name of your project, unique in the registry spring.cloud.consul.host = consul-client.okd.moon.testspring.cloud.consul.port = 80spring.cloud.consul.discovery.prefer-ip-address = truespring.cloud.consul.discovery.instanceId = ${spring.application.name}-${random.value} spring.cloud.consul.config.enabled = falsespring.cloud.consul.config.watch.wait-time = 20
4. If you access the monitoring system, add the configuration.
Org.springframework.boot spring-boot-starter-actuator io.micrometer micrometer-registry-prometheus 1.0.6
Add the relevant configuration required by the registry in application.properties:
# Monitoring requires management.endpoints.web.exposure.include = * management.endpoint.shutdown.enabled = falsemanagement.endpoint.health.show-details = always# to support quantile calculation management.metrics.distribution.percentiles-histogram.http.server.requests = true. After reading the above, have you mastered how to upgrade spring boot to spring cloud? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!