This tutorial aims to help readers complete the construction and use of the SpringCloud microservice system to help readers understand the concept of microservices in practice.
As the first part of the tutorial, we first build the registration and discovery service.
Build a simple Spring Boot project in IDEA, name the groupId: cn.com.hohistar.tutorial, and the artifactId: springcloud-discovery-server, and then replace the content in the original pom.xml file with the following:
Add @EnableEurekaServer annotation to the original startup class. The modified code is as follows:
Rename the file application.properties in src/main/resouces to: application.yml. And fill in the following content:
Start the application in IDEA, and then open it in the browser
You can see that the registration service has been started.
In next step, we will practice how to change an existing Spring Boot application into a registerable service.