To register any microservice with the Eureka Name server, we would need to add the dependency on Eureka Starter project. The following dependency needs to be added to the pom.xml file of Microservice A:
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency>
The next step is to add EnableDiscoveryClient to the SpringBootApplication classes. An example of MicroserviceAApplication is shown here:
@SpringBootApplication @EnableDiscoveryClient public class MicroserviceAApplication {