Spring Boot Tutorial 0/110 lessons ~6 min read Lesson 68
Service Discovery / Eureka
In a microservices world, services come and go.
Course progress0%
Focus
2 guided sections
Practice signal
Examples included
Career prep
Foundation builder
Introduction
In a microservices world, services come and go. Service discovery answers where is the orders service right now?. Eureka is Netflix's classic registry; Consul and Kubernetes' built-in DNS are common alternatives.
Informative example
bash
# Eureka Server@SpringBootApplication@EnableEurekaServerpublic class DiscoveryApp { public static void main(String[] a){ SpringApplication.run(DiscoveryApp.class,a);} }# application.yml (eureka server)server.port: 8761eureka:client:register-with-eureka: falsefetch-registry: false# Each service (client)@SpringBootApplicationpublic class OrdersApp { ... }# application.ymlspring:application:name: orders-serviceeureka:client:service-url:defaultZone: http://discovery:8761/eureka
Ready to mark this lesson complete?Track your journey across the entire course.