Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Spring Cloud: Creating Discovery server using Eureka Server

This tutorial is divided into 3 stages.

a.   Setting Discovery Server
b.   Setting Application Service
c.    Setting Application Client

In this post, I am going to explain how to set up discovery server.

Setting Discovery Server
Step 1: Go to ‘’ and create skelton project.

Give the Group name as ‘’, Artifact as ‘DiscoveryServer’ and add below dependencies.
a.   Eureka Server
b.   Spring Boot DevTools
c.    Spring Boot Actuator
Click on the button ‘Generate the project’.

Save the project.

Step 2: Extract the downloaded zip file.

Step 3: Import the downloaded project to Eclipse.

Open Eclipse.

File -> Import.

Search for Maven.

Select ‘Existing Maven Projects’. Click on Next button.

Browse the extracted application location, click on Finish button.

Imported project structure looks like below.

Step 2: Add ‘@EnableEurekaServer’ annotation to file.

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class DiscoveryServerApplication {

public static void main(String[] args) {, args);


Step 3: Update src/main/resources/ file.
It is used as the application name when registering with a service registry such as eureka.

Since we are running this server in standalone mode, we are telling Eureka client to not to register itself upon start up.

It will tell not to search for other registry nodes to connect to, as there are none.

Run the application on port 9090.


Open the url ‘http://localhost:9090/’ in browser, you can see below screen.

Previous                                                    Next                                                    Home

This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Spring Cloud: Creating Discovery server using Eureka Server


Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription