Skip to content

Register Account Create Service To Eureka Server

Piyush Chaudhari edited this page Aug 19, 2018 · 1 revision

Go to account-create-service and apply below change on build.gradle


ext {
springCloudVersion = 'Finchley.SR1'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}


Add below dependencies in your account-create-service project.

compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client') for service discovery

Refresh account-create-service from eclipse or STS based on your development tools.

Set below property on application.properties

spring.application.name = account-cerate-service

eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka
eureka.client.fetch-registry= true
eureka.instance.preferIpAddress=true
eureka.instance.leaseRenewalIntervalInSeconds=1
eureka.instance.leaseExpirationDurationInSeconds=2
ribbon.eureka.enabled=true

Go to mail class of account-create-service AccountCreateServiceApplication.java and add @EnableDiscoveryClient annotation