Eureka naming server in microservices
What you will learn here about microservices
- Eureka naming server in microservices
Note:
Download below project instead creating new because if versions are different then you will get error in pom.xml
Please click on below link to download sample project for creating naming server in microservices.
Download Eureka naming server sample project (96 downloads)Eureka naming server in microservices
Please follow the following steps to know how to create Eureka naming server in microservices
1)First create simple maven project
2)Add Eureka server and spring config dependency which is shown below
config dependency
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency>
Eureka server dependency
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency>
dev tools dependency(Optional)
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency>
3)Now open application.properties and application name, port number and other properties which is shown below
spring.application.name=naming-server server.port=8761 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false
4)Now enable eureka server using @EnableEurekaServer annotation which is shown below
5)Now please run you spring boot application
6)now go to browser and hit localhost:8761 url to see eureka dashboard which is shown below
7)If you are able to see above dashboard means naming server is created successfully.