Spring Cloud - studiofu/brain GitHub Wiki

Spring Cloud - Spring Cloud Netflix

  • Registry and Discovery - Eureka

  • Consumption - Robbin

  • Spring Cloud Hystrix

    • implement the circuit breaker
    • add spring-cloud-starter-hystrix
    • add @EnableCircuitBreaker to Application Class
    • add @@HystrixCommand to the method and define the fallbackMethod for handling the circuit break
    • add cache ← need more study
    • add batch call - HystrixCollapser ← need more study
  • Spring Cloud Feign

    • encapsulated the RestTemplate and just use the service
    • need to define the feign client interface by adding @FeignClient and then specify the service name
    • it is able to define the fallback method in the class level by applying the fallback = “{class}”
  • Spring Cloud Zuul

  • Spring Bus

    • use rabbitMQ
    • define connection in application properties
    • create Queue bean in @Configuration
    • use AmqpTemplate to send the message to the queue
    • template.convertAndSend(“hello”,“message”)
    • send to hello queue

Resources

Handle Security in Zuul, with OAuth2 and JWT

https://www.baeldung.com/spring-security-zuul-oauth-jwt

Spring Cloud下基于OAUTH2认证授权的实现

https://github.com/wiselyman/uaa-zuul

⚠️ **GitHub.com Fallback** ⚠️