Service Discovery
- Service Discovery Using Eureka
- Spring Cloud - Creating Eureka Server
- Spring Cloud - Creating Eureka Client
- Eureka Client Consumer Example
- Spring Cloud - Eureka Server API
- Spring Cloud - Eureka High Availablity
- Spring Cloud - Eureka Zone Awareness
Synchronous Communication
- Synchronous Communication with Feign Client
- Spring Cloud - Feign Client with Eureka
- Spring Cloud - Testing Feign Client
Synchronous Communication
- Spring Cloud - Gateway
- Spring Cloud - Creating Gateway Application
- Spring Cloud - Testing Gateway Application
- Spring Cloud - Monitoring Gateway Application
Miscellaneous
- Spring Cloud - Load Balancer
- Circuit Breaker using Hystrix
- Streams with Apache Kafka
- Distributed Logging using ELK and Sleuth
Spring Cloud Useful Resources
Spring Cloud - Test Feign Client
To test the Feign Client, run the project updated in Spring Cloud - Feign Client with Eureka as a spring boot app. It will run the service and register as restaurant-service with eureka.
Output - Eureka Client
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ [32m :: Spring Boot :: [39m [2m (v3.5.6)[0;39m ... [2m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [ main] [0;39m[36mo.s.c.n.e.s.EurekaServiceRegistry [0;39m [2m:[0;39m Registering application RESTAURANT-SERVICE with eureka with status UP [2m2025-10-08T11:19:51.001+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [ main] [0;39m[36mcom.netflix.discovery.DiscoveryClient [0;39m [2m:[0;39m Saw local status change event StatusChangeEvent [timestamp=1759902591001, current=UP, previous=STARTING] [2m2025-10-08T11:19:51.003+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [foReplicator-%d] [0;39m[36mcom.netflix.discovery.DiscoveryClient [0;39m [2m:[0;39m DiscoveryClient_RESTAURANT-SERVICE/Home:restaurant-service:8080: registering service... [2m2025-10-08T11:19:51.027+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [ main] [0;39m[36mo.s.b.w.embedded.tomcat.TomcatWebServer [0;39m [2m:[0;39m Tomcat started on port 8080 (http) with context path '/' [2m2025-10-08T11:19:51.028+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [ main] [0;39m[36m.s.c.n.e.s.EurekaAutoServiceRegistration[0;39m [2m:[0;39m Updating port to 8080 [2m2025-10-08T11:19:51.043+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [ main] [0;39m[36mc.t.e.EurekaclientApplication [0;39m [2m:[0;39m Started EurekaclientApplication in 2.427 seconds (process running for 3.147) [2m2025-10-08T11:19:51.049+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [foReplicator-%d] [0;39m[36mcom.netflix.discovery.DiscoveryClient [0;39m [2m:[0;39m DiscoveryClient_RESTAURANT-SERVICE/Home:restaurant-service:8080 - registration status: 204 [2m2025-10-08T11:20:12.672+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [nio-8080-exec-1] [0;39m[36mo.a.c.c.C.[Tomcat].[localhost].[/] [0;39m [2m:[0;39m Initializing Spring DispatcherServlet 'dispatcherServlet' [2m2025-10-08T11:20:12.672+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [nio-8080-exec-1] [0;39m[36mo.s.web.servlet.DispatcherServlet [0;39m [2m:[0;39m Initializing Servlet 'dispatcherServlet' [2m2025-10-08T11:20:12.673+05:30[0;39m [32m INFO[0;39m [35m44352[0;39m [2m--- [restaurant-service] [nio-8080-exec-1] [0;39m[36mo.s.web.servlet.DispatcherServlet [0;39m [2m:[0;39m Completed initialization in 1 ms
Output - Eureka Server
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ ... [2m2025-10-08T11:15:21.491+05:30[0;39m [32m INFO[0;39m [35m41940[0;39m [2m--- [ main] [0;39m[36mo.apache.catalina.core.StandardEngine [0;39m [2m:[0;39m Starting Servlet engine: [Apache Tomcat/10.1.46] [2m2025-10-08T11:15:21.537+05:30[0;39m [32m INFO[0;39m [35m41940[0;39m [2m--- [ main] [0;39m[36mo.a.c.c.C.[Tomcat].[localhost].[/] [0;39m [2m:[0;39m Initializing Spring embedded WebApplicationContext [2m2025-10-08T11:15:21.538+05:30[0;39m [32m INFO[0;39m [35m41940[0;39m [2m--- [ main] [0;39m[36mw.s.c.ServletWebServerApplicationContext[0;39m [2m:[0;39m Root WebApplicationContext: initialization completed in 1006 ms .. [2m2025-10-08T11:19:51.047+05:30[0;39m [32m INFO[0;39m [35m41940[0;39m [2m--- [nio-8761-exec-6] [0;39m[36mc.n.e.registry.AbstractInstanceRegistry [0;39m [2m:[0;39m Registered instance RESTAURANT-SERVICE/Home:restaurant-service:8080 with status UP (replication=false) [2m2025-10-08T11:19:51.577+05:30[0;39m [32m INFO[0;39m [35m41940[0;39m [2m--- [nio-8761-exec-7] [0;39m[36mc.n.e.registry.AbstractInstanceRegistry [0;39m [2m:[0;39m Registered instance RESTAURANT-SERVICE/Home:restaurant-service:8080 with status UP (replication=true)
Testing Services
In all, we have the following items running −
Standalone Eureka server
Customer service
Restaurant service
We can confirm that the above are working from the dashboard on http://localhost:8900/
Now, let us try to find all the restaurants which can serve to Jane who is placed in DC.
For this, first let us hit the customer service for the same: http://localhost:8080/customer/1
{
"id": 1,
"name": "Jane",
"city": "DC"
}
And then, make a call to the Restaurant Service via Feign Client: http://localhost:8080/restaurant/customer/1
[
{
"id": 1,
"name": "Pandas",
"city": "DC"
},
{
"id": 3,
"name": "Little Italy",
"city": "DC"
}
]
As we see, Jane can be served by 2 restaurants which are in DC area.
To conclude, as we see, without writing any boilerplate code and even specifying the address of the service, we can make HTTP calls to the services.