Microservices

# Actuator
# Swagger
# Feign client
# circuit breaker
* Hystrix
# Cloud Config server
* no need to restart
* changing configuration at run time
#Cloud config client
#API Gateway in microservices architecture
*Netflix Zuul
*ZUul Filter
* Api Gateway monitoring (search management endpoints actuator )
#How to get route for testing
#http://localhost:9005/actuator/routes
#http://localhost:9005/actuator
#Actuatar configuation with api gateway and did’t need any extra annoration
# check on — — — http://localhost:8900/actuator----

management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always

https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html

Microservices Registry & Discovery
* Eureka services Registry & Discovery

with the help of actuator
monitor and manage your application when you push it to production
#Enabling
add a dependency to the spring-boot-starter-actuator
#2. Endpoints
http://localhost:<port>/actuator
when you hit this url get some end pints

http://localhost:8999/actuator

Follow the Link for actuator

swagger helps developers design, build, document

add a dependency springfox-swagger2

@EnableSwagger2

<! — swagger2 →
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<! — swagger2 UI ENABLE →
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>

# communicate two microservices By using feign client.
# consume RetApi (we can use in place of RestTemplete).
# by using feign client we can set time out
# we can perfom LB
# to invoke external and internal API
@EnableFeignClients ()

@FeignClient(name = “userClient”, url = “http://localhost:8999/user")
public interface UserServices {
@GetMapping
List<User> getUserList();
@GetMapping(“/{id}”)
User getUser(@PathVariable(“id”) Integer id);
}
#dependency
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

if your services not responding then how to recover quickly
client — -> server
# in this communication client directly interact with server
so when server not responding it will throw exception
client — →circuit breaker(CB) — -> server
# all request handle by CB if server not responding then it will handle by CB.
throw a proper message and never disturb your flow of application
# it is a basic function to detect the current flow and fault tolerance and any interruption.

What are different states in the circuit breaker?
What are Cascading failures?
client — -> services(s1) — ->s2 — ->s3 — ->s4
client call s1 services for some data
s1 →s2 — -s3 →s4(s4 is failed)
client ←s1←s2←s3←s4
client get exception its called cascading Cascading failures

Who are different providers for circuit breaker design pattern?
#Hystrix(netflix)
#Spring retry
#resilience4j

Java||Spring-Boot|| Micro services Application developer|| angular || INDIA