Hystrix – a simple use case

Hystrix is a fault tolerance library that is very useful for managing failures in a distributed environment like microservices. Suppose we have a service A dependent on service B, which is in turn dependent on service C. A -> B -> C Let’s say a call is made from A to B. To serve this request, B needs to call C but there’s a communication failure between them. If the call from B to C is wrapped in Hystrix mechanism, we prevent the failure being propagated to A. [Read More]

Step by step guide to set up a service discovery environment

In a microservices environment we can run multiple instances of a service for resilience and scalability. In a cloud environment these instances can go up and down arbitrarily. So we need some kind of service discovery mechanism to keep track of running instances. When a service A needs to call a service B, it asks for the address of any running instance of service B from the service discovery. The service discovery can also load balance the incoming requests. [Read More]

How to set up a local spring cloud config server

From the official documentation, Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system. With the Config Server you have a central place to manage external properties for applications across all environments. Steps to configure config server a. Create a new Gradle project for the config server. In https://start.spring.io/, select the starters for config server. b. In your project, navigate to src/main/resources. Rename the automatically generated application. [Read More]