Friday, June 28, 2024

Service Health and Recovery

 How do we know, service is running or not?

  • Service discovery maintains the information of all services.
  • We implement using Eureka server
  • Maintains the status of every service, like it is up/down
  • Every request first goes to service discovery, then service is hit from API gateway.

What Is the use of actuator?

  • Actuator is used to configure hysteric dashboard. Main role of actuator is To check the heartbeat of a system in micro service environment, whether the system is alive or not.
  • If any service is not responding or sending heartbeat for a particular interval, it will disconnect from service, registry, server, or any other mechanisms.
  • From hystrix dashboard We can check whether any service is live or not.
  • We can use a circuit breaker pattern Which is the design pattern to increase the performance or to have a fallback mechanism.
  • The property used to enable or disable actuator is management.end points.web.exposure.include=*
How can we monitor applications and manage performance?
  • For application monitoring, we can use actuator. For service monitoring, we can use zipkins.
  • From zipkins Dashboard, we can check logs.
  • We can also use cloud watch or ELK to check logs to manage performance.
What is circuit breaker method? 
  • When a micro Service feels we can send a default message or we can define a default fallback method, and we can define hystrix properties. This will break the circuit and it will call default method and default message which we have defined.
  • The circuit breaks Depending upon the properties, for example, after her, a certain number of request or after a certain time out the default fallback method or Message is called.
How can we check the health of a service that is service is down or not?
Using hystrix And circuit breaker, where we can define fallback methods. In fallback method, we have the properties like set the time out milliseconds And number of request. Based on these, it will hit the default Method instead of original one.

No comments:

Post a Comment

Spring Boot

What is circular/cyclic dependency in spring boot? When two services are interdependent on each other, that is to start one service, we requ...