Skip to main content

Start Up Eureka Service Discovery In Spring Boot

Today , we are going to see Spring Boot Eureka Server Configuration  in STS  :

Step 1: Create Spring Starter Project in Spring Tool Suite :


Step 2: Do Java,Maven Configuration as below :



Step 3 : select Dependencies Eureka Discovery Client and Eureka Server


Step 4 : click Next - > Finish

Step 5 : Once all dependencies downloaded successfully , then add annotation @EnableEurekaServer on main class as below :



Step 6 : Edit Properties file as below :





	server.port=8001
	spring.application.name=discoveryservice
	eureka.client.registerWithEureka=false
	eureka.client.fetchRegistry=false
	eureka.client.serviceUrl.defaultZone= http://localhost:8001/eureka
Step 7: Run main class as spring boot app :




Step 8 : Once Application started succesfuly check in browser :
             now visit url : http://localhost:8001/ it will show UI as below  :



Finally our Eureka Server started as shown above ,lets understand properties in application.properties file in more details : 
1> eureka.client.registerWithEureka : 
its default value is true : we have given as false :
registerWithEureka Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances.

2>eureka.client.fetchRegistry :

its default value is true , fetchRegistry  Indicates whether this client should fetch eureka registry information from eureka server.

3>eureka.client.serviceUrl.defaultZone :

Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. 

Example: https://ec2-256-156-243-129.compute-1.azaws.com:7001/eureka/ .

Today we learned , How to start Eureka server in Spring Boot.


Happy Learning.

Popular Posts

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Today we will see solution for Error In Spring Boot : ***************************  APPLICATION FAILED TO START ***************************  Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.  Reason: Failed to determine a suitable driver class. --->My Application.yml : server: port: 8081 spring: datasource: driver-class-name: oracle.jdbc.driver.OracleDriver url: jdbc:oracle:thin:@localhost:1521:xe username: sys as sysdba password: root Oracle Version is 21 C Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production Version 21.3.0.0.0. check my pom.xml here : <? 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/m...

Stream In Java

stream in java 8 : Stream API is used to process collection of objects. stream() method is present in Collection interface from package java.util . Stream is an interface present in java.util package, filter() and map() methods are present in Stream interface. -->when to use filter()  method ? If we want to filter elements from collection based on some boolean condition then we can use filter() method.  for example  : filtering even or odd numbers from list of numbers. -->When to use map()  method ? If we want to create new object for every object in collection then we should use map() method. for example : if we want to increase every number in list by 2 , here every object is getting modified ,we have to use map() in this type of scenario. In below example , we used both filter() and map() methods on stream , inside filter method we applied some condition and in map method we are transforming our object to different one. package com.crtr4u.www; import java...

How much Software Engineer Earn in India

  No limit of earning for free lancer software developer : In service based companies - If Software Engineer work for same MNC from beginning of career then sometimes financial growth is low,still they can reach in between 7 lacs to 15 lacs in India. If programmer switch job after every 2-3 year and work for at least 5 years then they can earn minimum in between 14 lacs to 25 lacs for the position of Senior Software Engineer.  Being from a normal college , completed my education with average percentage , then  As 2 year experienced guy - I was getting offers of 8 lacs, 10 lacs  As 5 years experienced guy the offers are like  Minimum 12 lacs ,14 lacs, 18 lacs from Indian MNCs.  Money is  no bar for right candidate, if you are able to crack interview and if you can  write effective code then you can earn more than 20 lacs in India itself. Be motivated, improve your technical skills and yes you can earn great amount from Job too...  People with ...