Spring Boot Application Configured As Eureka Server

Posted By : Deepak Maurya | 10-Sep-2020

In Microservice architecture eureka server is an application that holds the information about all client-service applications. In microservice  each service  will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.

Let's start coding.

Add Eureka server dependency 


Add all dependencies and artifacts in pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
		<relativePath/> <!-- lookup parent from repository -->
	<description>Demo project for Spring Boot</description>
			<name>Spring Milestones</name>

Add Main Class for Eureka server 

public class RegistryServiceApplication {

	public static void main(String[] args) {
		SpringApplication.run(RegistryServiceApplication.class, args);


@EnableEurekaServer annotation , This annotation is used to make your Spring Boot application acts as a Eureka Server. In Eureka server all other Microservices can register themselves by using  service URL.

Add aplication.properties file


  • spring.application.name:  This property has been added to define a unique name for your application.
  • server.port: eureka server running at 10062 port
  • eureka.client.fetch-registry: Registry Service  doesn't register itself in eureka server.
  • eureka.client.register-with-eureka : this property is determines service register itself as a client in eureka server.


Test the Application 


I hope this post helps you understand about Eureka.There is a lot to learn. I only covered the basics in this post. In this post we implemented Eureka server as Discovery Server. each service  will register into the Eureka server.Eureka server knows all the services host and port.

I plan to write more posts on the Microservices, focusing on more complex features.


We are a 360-degree SaaS app development company that provides end-to-end software development services with a focus on next-gen technologies. Our development team specializes in using JavaScript technologies like Angular, Node, and ReactJS to build scalable, responsive, and feature-rich web applications.

About Author

Author Image
Deepak Maurya

Deepak is a backend developer and has knowledge of Java and Android. His hobbies are travelling and playing cricket.

Request for Proposal

Name is required

Comment is required

Sending message..