{"id":286,"date":"2025-11-01T05:55:00","date_gmt":"2025-11-01T05:55:00","guid":{"rendered":"https:\/\/harshad-sonawane.com\/blog\/?p=286"},"modified":"2025-10-25T17:08:34","modified_gmt":"2025-10-25T17:08:34","slug":"service-discovery-microservices-eureka-consul","status":"publish","type":"post","link":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/","title":{"rendered":"Role of Service Discovery in Microservices and How to Implement It with Eureka &#038; Consul"},"content":{"rendered":"<h2 data-start=\"93\" data-end=\"110\">Introduction<\/h2>\n<p data-start=\"111\" data-end=\"517\">In modern cloud-native architectures, <a href=\"https:\/\/harshad-sonawane.com\/blog\/reduce-cloud-costs-java-applications\/\">microservices<\/a> have become the preferred style for building scalable, resilient, and independently deployable applications. However, this architectural model introduces <strong data-start=\"317\" data-end=\"329\">dynamism<\/strong> and <strong data-start=\"334\" data-end=\"350\">distribution<\/strong>: services may scale up or down, move between hosts or containers, and network addresses may change. In this context, <strong data-start=\"468\" data-end=\"489\">service discovery<\/strong> emerges as a key pattern.<\/p>\n<p data-start=\"519\" data-end=\"853\">Service discovery means that services (clients) don\u2019t have to be hard-coded with the locations (hostnames\/IPs\/ports) of other services they depend on. Instead, they query a <strong data-start=\"692\" data-end=\"712\">service registry<\/strong> to find available instances of the required service. This enables more flexibility, dynamic scaling, failover, and decentralised topology.<\/p>\n<p data-start=\"855\" data-end=\"884\">In this blog we will cover:<\/p>\n<ul data-start=\"885\" data-end=\"1287\">\n<li data-start=\"885\" data-end=\"950\">\n<p data-start=\"887\" data-end=\"950\">Why service discovery matters in a <a href=\"https:\/\/harshad-sonawane.com\/blog\/eventual-consistency-distributed-java-systems\/\">microservices architecture<\/a><\/p>\n<\/li>\n<li data-start=\"951\" data-end=\"1003\">\n<p data-start=\"953\" data-end=\"1003\">Key roles and requirements for service discovery<\/p>\n<\/li>\n<li data-start=\"1004\" data-end=\"1095\">\n<p data-start=\"1006\" data-end=\"1095\">Two popular solutions in the Java\/Spring ecosystem: Netflix Eureka and HashiCorp Consul<\/p>\n<\/li>\n<li data-start=\"1096\" data-end=\"1175\">\n<p data-start=\"1098\" data-end=\"1175\">How to implement each in a <a href=\"https:\/\/harshad-sonawane.com\/blog\/audit-logging-in-java-microservices-techniques-and-compliance-tips\/\">Spring Boot<\/a> microservices project (code samples)<\/p>\n<\/li>\n<li data-start=\"1176\" data-end=\"1247\">\n<p data-start=\"1178\" data-end=\"1247\">Comparison of Eureka vs Consul: pros, cons and when to choose which<\/p>\n<\/li>\n<li data-start=\"1248\" data-end=\"1287\">\n<p data-start=\"1250\" data-end=\"1287\">Best-practices and operational tips<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"1289\" data-end=\"1292\" \/>\n<h2 data-start=\"1294\" data-end=\"1328\">Why Service Discovery Matters<\/h2>\n<p data-start=\"1329\" data-end=\"1596\">When you build microservices, you have a large number of independently deployed services. Each may run on different hosts or containers (especially in the cloud or <a href=\"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/\">Kubernetes<\/a>). A simplistic model might hard-code each service\u2019s URL in client code, but this is brittle:<\/p>\n<ul data-start=\"1598\" data-end=\"1880\">\n<li data-start=\"1598\" data-end=\"1678\">\n<p data-start=\"1600\" data-end=\"1678\">When you scale a service (multiple instances), you need some load-balancing.<\/p>\n<\/li>\n<li data-start=\"1679\" data-end=\"1739\">\n<p data-start=\"1681\" data-end=\"1739\">When an instance goes down or moves, clients must adapt.<\/p>\n<\/li>\n<li data-start=\"1740\" data-end=\"1799\">\n<p data-start=\"1742\" data-end=\"1799\">In cloud\/containers the IP\/port may change dynamically.<\/p>\n<\/li>\n<li data-start=\"1800\" data-end=\"1880\">\n<p data-start=\"1802\" data-end=\"1880\">You may have multiple environments (dev\/test\/prod) or multiple data-centres.<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"1882\" data-end=\"1930\">Service discovery addresses these challenges by:<\/p>\n<ul data-start=\"1932\" data-end=\"2320\">\n<li data-start=\"1932\" data-end=\"2038\">\n<p data-start=\"1934\" data-end=\"2038\">Providing a <strong data-start=\"1946\" data-end=\"1958\">registry<\/strong> where each service registers itself at startup (and deregisters on shutdown).<\/p>\n<\/li>\n<li data-start=\"2039\" data-end=\"2123\">\n<p data-start=\"2041\" data-end=\"2123\">Letting clients query the registry to get current instances of a target service.<\/p>\n<\/li>\n<li data-start=\"2124\" data-end=\"2198\">\n<p data-start=\"2126\" data-end=\"2198\">Often enabling health-checks so that unhealthy instances are excluded.<\/p>\n<\/li>\n<li data-start=\"2199\" data-end=\"2320\">\n<p data-start=\"2201\" data-end=\"2320\">Often integrating with load-balancing (client-side or server-side) so that the client doesn\u2019t pick a failed instance.<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"2322\" data-end=\"2630\">As the official Spring Cloud Netflix Eureka blog puts it: \u201cA service registry is a phone book for your microservices. Each service registers itself \u2026 Clients ask questions about the service topology (\u2018are there any fulfillment-services available, and if so, where?\u2019)\u201d. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Home<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<p data-start=\"2632\" data-end=\"2792\">So, in a microservices architecture, service discovery moves you away from fixed addresses towards dynamic, scalable, resilient communications between services.<\/p>\n<hr data-start=\"2794\" data-end=\"2797\" \/>\n<h2 data-start=\"2799\" data-end=\"2850\">Core Requirements &amp; Roles of Service Discovery<\/h2>\n<p data-start=\"2851\" data-end=\"2934\">When architecting service discovery, consider the following roles and requirements:<\/p>\n<ol data-start=\"2936\" data-end=\"4268\">\n<li data-start=\"2936\" data-end=\"3096\">\n<p data-start=\"2939\" data-end=\"3096\"><strong data-start=\"2939\" data-end=\"2955\">Registration<\/strong>: When a service instance starts (or periodically), it registers its metadata (name, host, port, health-check URL, tags) with the registry.<\/p>\n<\/li>\n<li data-start=\"3100\" data-end=\"3287\">\n<p data-start=\"3103\" data-end=\"3287\"><strong data-start=\"3103\" data-end=\"3135\">Deregistration \/ Heart-beats<\/strong>: When a service instance shuts down, or fails health-checks, it must deregister or be removed. The registry should reflect current healthy instances.<\/p>\n<\/li>\n<li data-start=\"3292\" data-end=\"3433\">\n<p data-start=\"3295\" data-end=\"3433\"><strong data-start=\"3295\" data-end=\"3308\">Discovery<\/strong>: A client (microservice) needs to query the registry (via API or DNS) to find available service instances of a given name.<\/p>\n<\/li>\n<li data-start=\"3438\" data-end=\"3573\">\n<p data-start=\"3441\" data-end=\"3573\"><strong data-start=\"3441\" data-end=\"3460\">Health-checking<\/strong>: The registry should monitor service instances (via heartbeat\/health-check) to avoid returning dead endpoints.<\/p>\n<\/li>\n<li data-start=\"3578\" data-end=\"3732\">\n<p data-start=\"3581\" data-end=\"3732\"><strong data-start=\"3581\" data-end=\"3599\">Load-balancing<\/strong>: After discovery, the client chooses an instance (round-robin, random, weighted, region-aware) or a proxy\/load-balancer picks one.<\/p>\n<\/li>\n<li data-start=\"3737\" data-end=\"3872\">\n<p data-start=\"3740\" data-end=\"3872\"><strong data-start=\"3740\" data-end=\"3768\">Scalability &amp; Resilience<\/strong>: The registry itself must be highly available, support clustering, multi-datacenter replication, etc.<\/p>\n<\/li>\n<li data-start=\"3877\" data-end=\"3966\">\n<p data-start=\"3880\" data-end=\"3966\"><strong data-start=\"3880\" data-end=\"3892\">Security<\/strong>: Access control, TLS, authentication of service registration\/discovery.<\/p>\n<\/li>\n<li data-start=\"3971\" data-end=\"4110\">\n<p data-start=\"3974\" data-end=\"4110\"><strong data-start=\"3974\" data-end=\"3993\">Metadata &amp; Tags<\/strong>: Services may register additional metadata (version, region, capabilities) which clients may use to filter\/select.<\/p>\n<\/li>\n<li data-start=\"4115\" data-end=\"4268\">\n<p data-start=\"4118\" data-end=\"4268\"><strong data-start=\"4118\" data-end=\"4152\">Integration with orchestration<\/strong>: In container\/Kubernetes environments, discovery may tie into orchestration (e.g., DNS names, labels, side-cars).<\/p>\n<\/li>\n<\/ol>\n<p data-start=\"4270\" data-end=\"4354\">These requirements define what a mature service discovery solution needs to support.<\/p>\n<hr data-start=\"4356\" data-end=\"4359\" \/>\n<h2 data-start=\"4361\" data-end=\"4408\">Implementing Service Discovery with Eureka<\/h2>\n<p data-start=\"4409\" data-end=\"4513\">Here\u2019s how you can implement service discovery using Eureka in a Spring Boot \/ Spring Cloud environment.<\/p>\n<h3 data-start=\"4515\" data-end=\"4543\">1. Setup Eureka Server<\/h3>\n<p data-start=\"4544\" data-end=\"4637\">Create a Spring Boot project (dependency <code data-start=\"4585\" data-end=\"4621\">spring-cloud-starter-eureka-server<\/code>). Example code:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-java\"><code class=\"whitespace-pre! language-java\"><span><span class=\"hljs-keyword\">package<\/span> com.example.registry;<\/span><\/code><\/code><span class=\"hljs-keyword\">import<\/span> org.springframework.boot.SpringApplication;<br \/><span class=\"hljs-keyword\">import<\/span> org.springframework.boot.autoconfigure.SpringBootApplication;<br \/><span class=\"hljs-keyword\">import<\/span> org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;<code class=\"whitespace-pre! language-java\"><code class=\"whitespace-pre! language-java\"><span><\/span><\/code><\/code><span class=\"hljs-meta\">@SpringBootApplication<\/span><br \/><span class=\"hljs-meta\">@EnableEurekaServer<\/span><br \/><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">EurekaServerApplication<\/span> {<br \/><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title function_\">main<\/span><span class=\"hljs-params\">(String[] args)<\/span> {<br \/>SpringApplication.run(EurekaServerApplication.class, args);<br \/>}<br \/>}<\/div>\n<\/div>\n<p data-start=\"5074\" data-end=\"5095\">In <code data-start=\"5077\" data-end=\"5094\">application.yml<\/code>:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-yaml\"><code class=\"whitespace-pre! language-yaml\"><span><span class=\"hljs-attr\">server:<\/span><br \/>\n<span class=\"hljs-attr\">port:<\/span> <span class=\"hljs-number\">8761<\/span><\/span><\/code><\/code><span class=\"hljs-attr\">eureka:<\/span><br \/><span class=\"hljs-attr\">client:<\/span><br \/><span class=\"hljs-attr\">registerWithEureka:<\/span> <span class=\"hljs-literal\">false<\/span><br \/><span class=\"hljs-attr\">fetchRegistry:<\/span> <span class=\"hljs-literal\">false<\/span><\/div>\n<\/div>\n<p data-start=\"5205\" data-end=\"5279\">This bootstraps a Eureka registry. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Home<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<h3 data-start=\"5281\" data-end=\"5328\">2. Configure Eureka Client (microservice)<\/h3>\n<p data-start=\"5329\" data-end=\"5364\">In each microservice (Spring Boot):<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-yaml\"><code class=\"whitespace-pre! language-yaml\"><span><span class=\"hljs-attr\">spring:<\/span><br \/>\n<span class=\"hljs-attr\">application:<\/span><br \/>\n<span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">order-service<\/span><\/span><\/code><\/code><span class=\"hljs-attr\">eureka:<\/span><br \/><span class=\"hljs-attr\">client:<\/span><br \/><span class=\"hljs-attr\">serviceUrl:<\/span><br \/><span class=\"hljs-attr\">defaultZone:<\/span> <span class=\"hljs-string\">http:\/\/localhost:8761\/eureka\/<\/span><\/div>\n<\/div>\n<p data-start=\"5510\" data-end=\"5607\">And add dependency: <code data-start=\"5530\" data-end=\"5574\">spring-cloud-starter-netflix-eureka-client<\/code>. Also annotate your application:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-java\"><span><span class=\"hljs-meta\">@SpringBootApplication<\/span><br \/>\n<span class=\"hljs-meta\">@EnableEurekaClient<\/span><br \/>\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">OrderServiceApplication<\/span> { \u2026 }<br \/>\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"5708\" data-end=\"5969\">When the service starts, it registers with the Eureka server and appears in the registry dashboard. Client-side discovery can then happen via <code data-start=\"5850\" data-end=\"5867\">DiscoveryClient<\/code> or through Spring Cloud load-balanced <code data-start=\"5906\" data-end=\"5920\">RestTemplate<\/code>\/<code data-start=\"5921\" data-end=\"5928\">Feign<\/code>. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Home<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<h3 data-start=\"5971\" data-end=\"6014\">3. Client-side Load-balancing Example<\/h3>\n<p data-start=\"6015\" data-end=\"6034\">Using Spring Cloud:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-java\"><code class=\"whitespace-pre! language-java\"><span><span class=\"hljs-meta\">@LoadBalanced<\/span><br \/>\n<span class=\"hljs-meta\">@Bean<\/span><br \/>\n<span class=\"hljs-keyword\">public<\/span> RestTemplate <span class=\"hljs-title function_\">restTemplate<\/span><span class=\"hljs-params\">()<\/span> {<br \/>\n<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-title class_\">RestTemplate<\/span>();<br \/>\n}<\/span><\/code><\/code><span class=\"hljs-meta\">@Autowired<\/span><br \/><span class=\"hljs-keyword\">private<\/span> RestTemplate restTemplate;<code class=\"whitespace-pre! language-java\"><code class=\"whitespace-pre! language-java\"><span><\/span><\/code><\/code><span class=\"hljs-keyword\">public<\/span> Order <span class=\"hljs-title function_\">getOrder<\/span><span class=\"hljs-params\">(String orderId)<\/span> {<br \/><span class=\"hljs-keyword\">return<\/span> restTemplate.getForObject(<span class=\"hljs-string\">&#8220;http:\/\/inventory-service\/inventory\/{id}&#8221;<\/span>, Order.class, orderId);<br \/>}<\/div>\n<\/div>\n<p data-start=\"6328\" data-end=\"6470\">Here <code data-start=\"6333\" data-end=\"6352\">inventory-service<\/code> is the Spring application name; Eureka resolves it to an instance via Ribbon. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Home<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<h3 data-start=\"6472\" data-end=\"6507\">4. Operational Considerations<\/h3>\n<ul data-start=\"6508\" data-end=\"6871\">\n<li data-start=\"6508\" data-end=\"6624\">\n<p data-start=\"6510\" data-end=\"6624\">Run multiple Eureka server instances (peer-to-peer) for high availability. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/www.geeksforgeeks.org\/advance-java\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/www.geeksforgeeks.org\/advance-java\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">GeeksforGeeks<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<\/li>\n<li data-start=\"6625\" data-end=\"6797\">\n<p data-start=\"6627\" data-end=\"6797\">Configure self-preservation mode: if heartbeats drop (e.g., network partition), Eureka enters a mode to avoid mass deregistration. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<\/li>\n<li data-start=\"6798\" data-end=\"6871\">\n<p data-start=\"6800\" data-end=\"6871\">Monitor registry health, cleanup stale instances, manage zones\/regions.<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"6873\" data-end=\"6876\" \/>\n<h2 data-start=\"6878\" data-end=\"6925\">Implementing Service Discovery with Consul<\/h2>\n<p data-start=\"6926\" data-end=\"7076\">Now let\u2019s look at how you can implement service discovery using Consul, which offers a more advanced feature set beyond simple registration\/discovery.<\/p>\n<h3 data-start=\"7078\" data-end=\"7106\">1. Setup Consul Server<\/h3>\n<p data-start=\"7107\" data-end=\"7151\">Download and run Consul (e.g., in dev mode):<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span><span class=\"hljs-attribute\">consul<\/span> agent -dev<br \/>\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"7180\" data-end=\"7280\">This will start a single-node Consul server with builtin UI and HTTP API for service registration.<\/p>\n<h3 data-start=\"7282\" data-end=\"7337\">2. Configure Spring Boot Service as Consul Client<\/h3>\n<p data-start=\"7338\" data-end=\"7446\">In a Spring Boot microservice, use dependency <code data-start=\"7384\" data-end=\"7423\">spring-cloud-starter-consul-discovery<\/code>. In <code data-start=\"7428\" data-end=\"7445\">application.yml<\/code>:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-yaml\"><code class=\"whitespace-pre! language-yaml\"><span><span class=\"hljs-attr\">spring:<\/span><br \/>\n<span class=\"hljs-attr\">application:<\/span><br \/>\n<span class=\"hljs-attr\">name:<\/span> <span class=\"hljs-string\">payment-service<\/span><\/span><\/code><\/code><span class=\"hljs-attr\">spring:<\/span><br \/><span class=\"hljs-attr\">cloud:<\/span><br \/><span class=\"hljs-attr\">consul:<\/span><br \/><span class=\"hljs-attr\">host:<\/span> <span class=\"hljs-string\">localhost<\/span><br \/><span class=\"hljs-attr\">port:<\/span> <span class=\"hljs-number\">8500<\/span><br \/><span class=\"hljs-attr\">discovery:<\/span><br \/><span class=\"hljs-attr\">serviceName:<\/span> <span class=\"hljs-string\">${spring.application.name}<\/span><br \/><span class=\"hljs-attr\">healthCheckPath:<\/span> <span class=\"hljs-string\">\/actuator\/health<\/span><br \/><span class=\"hljs-attr\">healthCheckInterval:<\/span> <span class=\"hljs-string\">10s<\/span><\/div>\n<\/div>\n<p data-start=\"7719\" data-end=\"7733\">Annotate with:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-java\"><span><span class=\"hljs-meta\">@SpringBootApplication<\/span><br \/>\n<span class=\"hljs-meta\">@EnableDiscoveryClient<\/span><br \/>\n<span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title class_\">PaymentServiceApplication<\/span> { \u2026 }<br \/>\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"7839\" data-end=\"7964\">Now the service registers itself with Consul and can be discovered by other services. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/rathoreaparna678.medium.com\/service-discovery-and-registration-eureka-consul-1c715b51f9a?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/rathoreaparna678.medium.com\/service-discovery-and-registration-eureka-consul-1c715b51f9a?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Medium<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<h3 data-start=\"7966\" data-end=\"7997\">3. Discovery via HTTP\/DNS<\/h3>\n<p data-start=\"7998\" data-end=\"8062\">Other services can query Consul\u2019s HTTP API or use DNS interface:<\/p>\n<ul data-start=\"8064\" data-end=\"8187\">\n<li data-start=\"8064\" data-end=\"8129\">\n<p data-start=\"8066\" data-end=\"8129\">HTTP: <code data-start=\"8072\" data-end=\"8129\">http:\/\/localhost:8500\/v1\/health\/service\/payment-service<\/code><\/p>\n<\/li>\n<li data-start=\"8130\" data-end=\"8187\">\n<p data-start=\"8132\" data-end=\"8187\">DNS: <code data-start=\"8137\" data-end=\"8169\">payment-service.service.consul<\/code> (if configured)<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"8189\" data-end=\"8351\">Consul supports multi-datacenter, DNS and HTTP discovery, rich health-checks, key-value store, service-mesh integration. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<h3 data-start=\"8353\" data-end=\"8388\">4. Operational Considerations<\/h3>\n<ul data-start=\"8389\" data-end=\"8739\">\n<li data-start=\"8389\" data-end=\"8493\">\n<p data-start=\"8391\" data-end=\"8493\">Run at least 3 server nodes for production in a raft quorum. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/blog.nashtechglobal.com\/comparing-eureka-vs-consul-io\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/blog.nashtechglobal.com\/comparing-eureka-vs-consul-io\/?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">blog.nashtechglobal.com<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<\/li>\n<li data-start=\"8494\" data-end=\"8590\">\n<p data-start=\"8496\" data-end=\"8590\">Define health-checks, use ACLs and TLS for security. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><\/span><\/span><\/a><\/span><\/span><\/p>\n<\/li>\n<li data-start=\"8591\" data-end=\"8659\">\n<p data-start=\"8593\" data-end=\"8659\">Use tags\/metadata so clients can filter by version, region, etc.<\/p>\n<\/li>\n<li data-start=\"8660\" data-end=\"8739\">\n<p data-start=\"8662\" data-end=\"8739\">Consider using Consul Connect for service mesh features (optional, advanced).<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"8741\" data-end=\"8744\" \/>\n<h2 data-start=\"8746\" data-end=\"8785\">Eureka vs Consul: Which to Choose?<\/h2>\n<p data-start=\"8786\" data-end=\"8845\">Here\u2019s a comparison of the two, based on practical factors.<\/p>\n<div class=\"_tableContainer_1rjym_1\">\n<div class=\"group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table data-start=\"8847\" data-end=\"10190\" class=\"w-fit min-w-(--thread-content-width)\">\n<thead data-start=\"8847\" data-end=\"8876\">\n<tr data-start=\"8847\" data-end=\"8876\">\n<th data-start=\"8847\" data-end=\"8857\" data-col-size=\"sm\">Feature<\/th>\n<th data-start=\"8857\" data-end=\"8866\" data-col-size=\"md\">Eureka<\/th>\n<th data-start=\"8866\" data-end=\"8876\" data-col-size=\"md\">Consul<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"8907\" data-end=\"10190\">\n<tr data-start=\"8907\" data-end=\"9171\">\n<td data-start=\"8907\" data-end=\"8948\" data-col-size=\"sm\">Spring Boot \/ Spring Cloud Integration<\/td>\n<td data-start=\"8948\" data-end=\"9042\" data-col-size=\"md\">Excellent \u2014 part of Spring Cloud Netflix ecosystem. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/spring.io\/blog\/2015\/01\/20\/microservice-registration-and-discovery-with-spring-cloud-and-netflix-s-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">Home<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<td data-start=\"9042\" data-end=\"9171\" data-col-size=\"md\">Good \u2014 supported via <code data-start=\"9065\" data-end=\"9094\">spring-cloud-starter-consul<\/code>, but may require additional setup. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<\/tr>\n<tr data-start=\"9172\" data-end=\"9349\">\n<td data-start=\"9172\" data-end=\"9193\" data-col-size=\"sm\">Simplicity \/ Setup<\/td>\n<td data-start=\"9193\" data-end=\"9295\" data-col-size=\"md\">Very simple to bootstrap; great for Java\/Spring ecosystems. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/www.geeksforgeeks.org\/advance-java\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/www.geeksforgeeks.org\/advance-java\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">GeeksforGeeks<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<td data-start=\"9295\" data-end=\"9349\" data-col-size=\"md\">Slightly more complex; more features to configure.<\/td>\n<\/tr>\n<tr data-start=\"9350\" data-end=\"9549\">\n<td data-start=\"9350\" data-end=\"9377\" data-col-size=\"sm\">Multi-Datacenter Support<\/td>\n<td data-start=\"9377\" data-end=\"9452\" data-col-size=\"md\">Limited; requires custom config. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/blog.nashtechglobal.com\/comparing-eureka-vs-consul-io\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/blog.nashtechglobal.com\/comparing-eureka-vs-consul-io\/?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">blog.nashtechglobal.com<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<td data-start=\"9452\" data-end=\"9549\" data-col-size=\"md\">Built-in support for multi-datacenters, DNS &amp; gossip. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><span class=\"-me-1 flex h-full items-center rounded-full px-1 text-[#8F8F8F]\">+1<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<\/tr>\n<tr data-start=\"9550\" data-end=\"9787\">\n<td data-start=\"9550\" data-end=\"9589\" data-col-size=\"sm\">Health Checks \/ Metadata \/ Ecosystem<\/td>\n<td data-start=\"9589\" data-end=\"9677\" data-col-size=\"md\">Basic health-checks; fewer advanced features. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/www.geeksforgeeks.org\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/www.geeksforgeeks.org\/eureka-vs-consul-service-registry-comparison\/?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">GeeksforGeeks<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<td data-start=\"9677\" data-end=\"9787\" data-col-size=\"md\">Rich health-checks, tags, key-value store, service mesh readiness. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/stackshare.io\/stackups\/consul-vs-eureka?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/stackshare.io\/stackups\/consul-vs-eureka?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">StackShare<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<\/tr>\n<tr data-start=\"9788\" data-end=\"9977\">\n<td data-start=\"9788\" data-end=\"9812\" data-col-size=\"sm\">Community \/ Longevity<\/td>\n<td data-start=\"9812\" data-end=\"9915\" data-col-size=\"md\">Mature, but Netflix has declared Eureka as maintenance-only. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/dev.to\/isaactony\/comparison-of-spring-cloud-with-eureka-vs-consulio-3hgm?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">DEV Community<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<td data-start=\"9915\" data-end=\"9977\" data-col-size=\"md\">Actively developed (HashiCorp backing), broader ecosystem.<\/td>\n<\/tr>\n<tr data-start=\"9978\" data-end=\"10190\">\n<td data-start=\"9978\" data-end=\"9990\" data-col-size=\"sm\">Use Cases<\/td>\n<td data-start=\"9990\" data-end=\"10073\" data-col-size=\"md\">Best for relatively small to medium Java\/Spring microservices, internal systems.<\/td>\n<td data-start=\"10073\" data-end=\"10190\" data-col-size=\"md\">Best for large-scale, polyglot, multi-region systems with advanced needs. <span class=\"\" data-state=\"closed\"><span class=\"ms-1 inline-flex max-w-full items-center relative top-[-0.094rem] animate-[show_150ms_ease-in]\" data-testid=\"webpage-citation-pill\"><a href=\"https:\/\/lazycodet.com\/211\/read\/639\/comparing-scalecube-eureka-and-consul-for-service-discovery-in-microservices?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noopener\" alt=\"https:\/\/lazycodet.com\/211\/read\/639\/comparing-scalecube-eureka-and-consul-for-service-discovery-in-microservices?utm_source=chatgpt.com\" class=\"flex h-4.5 overflow-hidden rounded-xl px-2 text-[9px] font-medium transition-colors duration-150 ease-in-out text-token-text-secondary! bg-[#F4F4F4]! dark:bg-[#303030]!\"><span class=\"relative start-0 bottom-0 flex h-full w-full items-center\"><span class=\"flex h-4 w-full items-center justify-between overflow-hidden\"><span class=\"max-w-[15ch] grow truncate overflow-hidden text-center\">lazycodet.com<\/span><\/span><\/span><\/a><\/span><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p data-start=\"10192\" data-end=\"10212\"><strong data-start=\"10192\" data-end=\"10210\">Recommendation<\/strong><\/p>\n<ul data-start=\"10213\" data-end=\"10529\">\n<li data-start=\"10213\" data-end=\"10346\">\n<p data-start=\"10215\" data-end=\"10346\">Choose <strong data-start=\"10222\" data-end=\"10232\">Eureka<\/strong> when you have a homogeneous Spring Boot environment, moderate scale, and you value ease of use and integration.<\/p>\n<\/li>\n<li data-start=\"10347\" data-end=\"10529\">\n<p data-start=\"10349\" data-end=\"10529\">Choose <strong data-start=\"10356\" data-end=\"10366\">Consul<\/strong> when you need features like multi-region, strong health-checks, polyglot services, key-value store, future service-mesh, or want vendor-agnostic infrastructure.<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"10531\" data-end=\"10534\" \/>\n<h2 data-start=\"10536\" data-end=\"10573\">Best Practices &amp; Common Pitfalls<\/h2>\n<ul data-start=\"10574\" data-end=\"11824\">\n<li data-start=\"10574\" data-end=\"10676\">\n<p data-start=\"10576\" data-end=\"10676\">Always run the registry in a <strong data-start=\"10605\" data-end=\"10626\">high-availability<\/strong> configuration (multiple instances, clustering).<\/p>\n<\/li>\n<li data-start=\"10677\" data-end=\"10820\">\n<p data-start=\"10679\" data-end=\"10820\">Register services with meaningful <strong data-start=\"10713\" data-end=\"10725\">metadata<\/strong> (version, region, tags) so clients can discover the right instance (e.g., version v2 vs v1).<\/p>\n<\/li>\n<li data-start=\"10821\" data-end=\"10927\">\n<p data-start=\"10823\" data-end=\"10927\">Ensure <strong data-start=\"10830\" data-end=\"10847\">health-checks<\/strong> are well defined so that failing instances are removed from registry quickly.<\/p>\n<\/li>\n<li data-start=\"10928\" data-end=\"11020\">\n<p data-start=\"10930\" data-end=\"11020\">Avoid <strong data-start=\"10936\" data-end=\"10951\">hard-coding<\/strong> service endpoints; always rely on service name + client discovery.<\/p>\n<\/li>\n<li data-start=\"11021\" data-end=\"11127\">\n<p data-start=\"11023\" data-end=\"11127\">Use <strong data-start=\"11027\" data-end=\"11057\">client-side load-balancing<\/strong> (Ribbon\/Feign) or server-side proxy depending on your architecture.<\/p>\n<\/li>\n<li data-start=\"11128\" data-end=\"11235\">\n<p data-start=\"11130\" data-end=\"11235\">Monitor registry performance and size: in very large deployments, the registry can become a bottleneck.<\/p>\n<\/li>\n<li data-start=\"11236\" data-end=\"11340\">\n<p data-start=\"11238\" data-end=\"11340\">Secure registrations and discovery: ensure only authorized services register\/discover, use TLS\/ACLs.<\/p>\n<\/li>\n<li data-start=\"11341\" data-end=\"11451\">\n<p data-start=\"11343\" data-end=\"11451\">Use <strong data-start=\"11347\" data-end=\"11370\">fallback\/resilience<\/strong>: clients should handle registry unavailability gracefully (e.g., cached list).<\/p>\n<\/li>\n<li data-start=\"11452\" data-end=\"11568\">\n<p data-start=\"11454\" data-end=\"11568\">Dispose stale registrations: services that crash or do not heartbeat should be evicted to avoid stale endpoints.<\/p>\n<\/li>\n<li data-start=\"11569\" data-end=\"11689\">\n<p data-start=\"11571\" data-end=\"11689\">Versioning &amp; compatibility: when doing rolling upgrades, use tags or meta-data to route clients to correct versions.<\/p>\n<\/li>\n<li data-start=\"11690\" data-end=\"11824\">\n<p data-start=\"11692\" data-end=\"11824\">Use <strong data-start=\"11696\" data-end=\"11713\">zones\/regions<\/strong> awareness: in multi-region deployments, clients should prefer local instances for latency, fallback to remote.<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"11826\" data-end=\"11829\" \/>\n<h2 data-start=\"11831\" data-end=\"11843\">Summary<\/h2>\n<p data-start=\"11844\" data-end=\"12076\">Service discovery is a foundational building block in microservices architectures: it enables dynamic service registration, discovery, and client-side flexibility, which leads to better scalability, resilience and maintainability.<\/p>\n<p data-start=\"12078\" data-end=\"12407\">In the Java\/Spring ecosystem, Eureka and Consul remain two popular choices. Eureka offers simplicity and deep Spring integration, while Consul delivers richer features and support for larger, distributed, polyglot, multi-region systems. Choosing the right tool depends on your scale, architecture, ecosystem, and future growth.<\/p>\n<p data-start=\"12409\" data-end=\"12610\">By following best practices on registration, health-checks, load-balancing, metadata and monitoring, you can ensure your microservices communicate reliably and adapt dynamically as your system evolves.<\/p>\n\n\n<p class=\"o-typing-delay-100ms ticss-27f7e3e9\"><o-anim-typing>&lt;> <strong>&#8220;Happy developing, one line at a time!&#8221;<\/strong> &lt;\/><\/o-anim-typing><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In modern cloud-native architectures, microservices have become the preferred style for building scalable, resilient, and independently deployable applications. However, this architectural model introduces dynamism and distribution: services may scale up or down, move between hosts or containers, and network addresses may change. In this context, service discovery emerges as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":"","jetpack_publicize_message":"  I\u2019ve just published an in-depth technical guide on the Role of Service Discovery in Microservices \u2014 covering why it matters, how to implement it using Eureka & Consul, full Spring Boot code samples, and a head-to-head comparison to help you choose the right tool.\nIf you're working with Java microservices or cloud-native architecture, this one\u2019s for you.\n#Microservices #SpringBoot #ServiceDiscovery #Eureka #Consul #CloudArchitecture","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[113],"tags":[2,9],"class_list":["post-286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-spring-boot-aws-microservices","tag-java","tag-microservices"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Role of Service Discovery in Microservices and How to Implement It with Eureka &amp; Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;<\/title>\n<meta name=\"description\" content=\"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Role of Service Discovery in Microservices and How to Implement It with Eureka &amp; Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;\" \/>\n<meta property=\"og:description\" content=\"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/\" \/>\n<meta property=\"og:site_name\" content=\"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-01T05:55:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"HS\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"HS\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/\"},\"author\":{\"name\":\"HS\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"headline\":\"Role of Service Discovery in Microservices and How to Implement It with Eureka &#038; Consul\",\"datePublished\":\"2025-11-01T05:55:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/\"},\"wordCount\":1420,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png\",\"keywords\":[\"Java\",\"Microservices\"],\"articleSection\":[\"Java, Spring Boot, AWS, Microservices\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/\",\"name\":\"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\\\/&gt;\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png\",\"datePublished\":\"2025-11-01T05:55:00+00:00\",\"description\":\"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#primaryimage\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png\",\"contentUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png\",\"width\":1536,\"height\":1024,\"caption\":\"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/service-discovery-microservices-eureka-consul\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Role of Service Discovery in Microservices and How to Implement It with Eureka &#038; Consul\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/\",\"name\":\"Harshad's Dev Diary\",\"description\":\"HARSHAD&#039;s Dev Diary\",\"publisher\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\",\"name\":\"HS\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"contentUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"width\":400,\"height\":400,\"caption\":\"HS\"},\"logo\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\"},\"sameAs\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\"],\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","description":"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/","og_locale":"en_US","og_type":"article","og_title":"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","og_description":"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.","og_url":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/","og_site_name":"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","article_published_time":"2025-11-01T05:55:00+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png","type":"image\/png"}],"author":"HS","twitter_card":"summary_large_image","twitter_misc":{"Written by":"HS","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#article","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/"},"author":{"name":"HS","@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"headline":"Role of Service Discovery in Microservices and How to Implement It with Eureka &#038; Consul","datePublished":"2025-11-01T05:55:00+00:00","mainEntityOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/"},"wordCount":1420,"commentCount":0,"publisher":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png","keywords":["Java","Microservices"],"articleSection":["Java, Spring Boot, AWS, Microservices"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/","url":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/","name":"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#primaryimage"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png","datePublished":"2025-11-01T05:55:00+00:00","description":"Explore service discovery in microservices with Eureka and Consul. Learn how these tools enhance cloud-native architectures.","breadcrumb":{"@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#primaryimage","url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png","contentUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_09_07-PM.png","width":1536,"height":1024,"caption":"Role of Service Discovery in Microservices and How to Implement It with Eureka & Consul"},{"@type":"BreadcrumbList","@id":"https:\/\/harshad-sonawane.com\/blog\/service-discovery-microservices-eureka-consul\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/harshad-sonawane.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Role of Service Discovery in Microservices and How to Implement It with Eureka &#038; Consul"}]},{"@type":"WebSite","@id":"https:\/\/harshad-sonawane.com\/blog\/#website","url":"https:\/\/harshad-sonawane.com\/blog\/","name":"Harshad's Dev Diary","description":"HARSHAD&#039;s Dev Diary","publisher":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/harshad-sonawane.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e","name":"HS","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","contentUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","width":400,"height":400,"caption":"HS"},"logo":{"@id":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg"},"sameAs":["https:\/\/harshad-sonawane.com\/blog"],"url":"https:\/\/harshad-sonawane.com\/blog\/author\/admin\/"}]}},"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":6,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":299,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/286\/revisions\/299"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media\/292"}],"wp:attachment":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}