Skip to content

Spring Cloud

Johnson Fu edited this page Jul 10, 2020 · 4 revisions

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

  • freemarker
  • thymeleaf
  • JMX (jconsole)
  • ZeroMQ
  • microk8s
  • multipass
  • pwsh (powershell)

Clone this wiki locally