In this write-up we will focus on
- Service Registry – Eureka Server
- Rest service (auth-service application, eureka client) which register itself to registry.
- Web application which consumes Rest service using service registry.
Service discovery allows services to find and communicate with each other without hardcoding hostname and port.
Eureka Server
In spring-boot application enable the Eureka-Server by adding @EnableEurekaServer annotation to spring boot application.
We have put all the configuration on GIT and this is accessed using config-server. To now more about centralized configuration (config-server) click here
Place below bootstrap.yml in application, it basically connects to config-server and gets it required configuration.
Start the spring-boot application and access eureka server using http://localhost:8760/ you will get below screen.
Right now there is no application which is registered to eureka-server. Once you start the application which is register to eureka-server you will start seeing application name, its status, availability zone etc in eureka sever.
Note: We have not yet secured eureka-server with userid/password.
Cheers – Happy learning 🙂
Ketan Gote
Comments
Post a Comment