Eureka Client
How to register the Spring Boot Micro service application into the Eureka Server?
When a client registers with Eureka, it provides meta-data about itself- such as host, port, health indicator URL, the home page, and other details. Eureka receives heartbeat messages from each instance belonging to a service. If the heartbeat fails over a configurable timetable, the instance is normally removed from the registry.
Add the following dependencies into the build.gradle file:
compile('org.springframework.cloud:spring-cloud-starter-eureka')
Add the @EnableEurekaClient annotation in the main Spring Boot application class file. The annotation makes your Spring Boot application act as a Eureka client.
To register the Spring Boot application into Eureka Server we need to add the following configuration in our application.properties file or application.yml file and specify the Eureka Server URL in our configuration.
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka
spring:
application:
name: eurekaclient

Last updated
Was this helpful?