Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to live in a post-Spring-Cloud-Netflix world

How to live in a post-Spring-Cloud-Netflix world

Zuul? Gateway? Should we get rid of Ribbon? What is going on with Hystrix? If you have ever faced those questions, come and listen to this talk. In December 2018, Netflix decided to move a number of their popular OSS projects, like Hystrix and Ribbon into maintenance mode and to make newer, backward incompatible versions of some others, like Zuul and Archaius. The Spring Cloud team moved some of the corresponding Spring-Cloud-Netflix projects into maintenance mode as well and proposed a newer, more modern Spring Cloud stack that could be used instead. During this talk, we would like to show how to move over to these newer solutions. We will discuss possible approaches, show a code demo and speak about potential issues and solutions.

Olga Maciaszek-Sharma

March 15, 2019
Tweet

More Decks by Olga Maciaszek-Sharma

Other Decks in Programming

Transcript

  1. © Copyright 2018 Pivotal Software, Inc. All rights Reserved. Version 1.0
    Olga Maciaszek-Sharma, @olga_maciaszek
    Marcin Grzejszczak, @mgrzejszczak
    Gdańsk, 15.03.2019
    How to live in a
    post-Spring-Cloud-Netflix world

    View full-size slide

  2. About Us
    Olga Maciaszek-Sharma
    (@olga_maciaszek)
    Senior Software Engineer in Spring
    Cloud team. Works mostly on:
    ● Spring Cloud Contract
    ● Spring Cloud Netflix
    ● Spring Cloud Gateway
    ● Spring Cloud OpenFeign
    https://github.com/OlgaMaciaszek
    Marcin Grzejszczak
    (@mgrzejszczak)
    Spring Cloud developer. Works mostly
    on:
    ● Spring Cloud Contract
    ● Spring Cloud Sleuth
    ● Cloud Pipelines
    Blog: http://toomuchcoding.com

    View full-size slide

  3. Spring + Netflix during Cloud-Native transition
    Spring Cloud Netflix Eureka Client
    Spring Cloud Netflix Eureka Server
    Spring Cloud Netflix Archaius
    Spring Cloud Netflix Ribbon
    Spring Cloud Netflix Zuul
    Spring Cloud Netflix Hystrix
    Spring Cloud Netflix Hystrix Dashboard
    Spring Cloud Netflix Turbine
    Spring Cloud Netflix Hystrix Stream
    Spring Cloud Netflix Turbine Stream

    View full-size slide

  4. Netflix projects passed into maintenance or superseded
    ● Ribbon, 2016 -
    https://github.com/Netflix/ribbon#project-status-on-maintenance
    ● Hystrix Dashboard → Atlas
    ● Zuul 1 → backward incompatible Zuul 2
    ● Archaius 1 → backward incompatible Archaius 2
    ● Hystrix, 2018 - https://github.com/Netflix/Hystrix#hystrix-status

    View full-size slide

  5. Spring Cloud Netflix
    Maintenance Mode
    Greenwich RC1 announcement

    View full-size slide

  6. Spring + Netflix going into maintenance
    Spring Cloud Netflix Eureka Client
    Spring Cloud Netflix Eureka Server
    Spring Cloud Netflix Archaius
    Spring Cloud Netflix Ribbon
    Spring Cloud Netflix Zuul
    Spring Cloud Netflix Hystrix
    Spring Cloud Netflix Hystrix Dashboard
    Spring Cloud Netflix Turbine
    Spring Cloud Netflix Hystrix Stream
    Spring Cloud Netflix Turbine Stream

    View full-size slide

  7. Maintenance Mode
    No new features
    Fixes for blockers and security issues only
    Considering and reviewing small PRs from the community

    View full-size slide

  8. User CardService
    UserService
    Proxy
    FraudVerifier
    Create
    new user
    Verify
    new user
    Register
    application
    Create
    new user

    View full-size slide

  9. Demo
    Old Stack
    Card Application
    Service
    (Ribbon Load Balancer)
    Zuul Proxy
    (Hystrix, Hystrix
    Dashboard)
    User Service
    (Hystrix, Hystrix
    Dashboard)
    Fraud
    Verifier
    Turbine App
    Ignored
    Service
    Eureka
    Service
    Discovery

    View full-size slide

  10. Spring Cloud New Stack
    DEMO

    View full-size slide

  11. Spring Cloud New Stack
    Time to make the transition

    View full-size slide

  12. Spring Cloud Netflix Ribbon → Spring Cloud Load Balancer
    @Bean
    @LoadBalanced
    WebClient.Builder loadBalancedWebClientBuilder() {
    return WebClient.builder();
    }
    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
    return new RestTemplate();
    }
    @RibbonClient()
    @RibbonClients()
    @Bean
    @LoadBalanced
    WebClient.Builder loadBalancedWebClientBuilder() {
    return WebClient.builder();
    }
    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
    return new RestTemplate();
    }
    @LoadBalancerClient()
    @LoadBalancerClients()

    View full-size slide

  13. Spring Cloud Netflix Ribbon → Spring Cloud Load Balancer
    Lacking implementations
    Spring Cloud Netflix Ribbon still used in other projects

    View full-size slide

  14. Spring Cloud Netflix Zuul → Spring Cloud Gateway
    ● Non-reactive, Servlet-based
    ● Routing by serviceId by default
    ● Possibility to set up options via properties,
    including ignored services, patterns and
    headers and ignoring sensitive headers (true
    by default)
    ● Routes set in properties with limited config (id,
    serviceId, path, url, stripPrefix,
    retrayable, sensitiveHeaders,
    customSensitiveHeaders)
    ● Reactive, Netty-based
    ● Explicit route setup required
    ● Possibility to define routes both via properties
    and via functional configuration
    ● Predicates and Filters
    ● All headers passed on by default

    View full-size slide

  15. Spring Cloud Hystrix → SC CircuitBreaker + Resilience4J
    ● Uses Hystrix underneath
    ● Possibility to use via @HystrixCommand
    annotation
    ● Possibility to pass fallback method in annotation
    ● A Spring Cloud abstraction for circuit breakers
    https://github.com/spring-cloud-incubator/spring
    -cloud-circuitbreaker
    ● Currently supports Hystrix and Resilience4J
    ● Using via injected CircuitBreakerFactory
    bean and its create() method
    ● Possibility to configure by setting up
    Customizer bean
    in a @Configuration class

    View full-size slide

  16. Spring Cloud Netflix Turbine → Micrometer + Prometheus
    ● Aggregated Hystrix metrics from various
    applications via HTTP
    ● Via the Turbine Stream, managed to collect
    those via messaging
    ● Micrometer - a metrics collection facade
    ● Its aim is to allow you to time, count, and gauge
    your code with a vendor neutral API
    ● One of the monitoring systems to which you can
    output the metrics is Prometheus

    View full-size slide

  17. Spring Cloud Netflix Archaius → SC Config Server

    View full-size slide

  18. Demo
    New Stack
    Card Application
    Service
    (SC
    LoadBalancerClient,
    Micrometer)
    Gateway
    Proxy
    (CircuitBreaker,
    Micrometer)
    User Service
    ([Resilience4J],
    Micrometer)
    Fraud Service
    (Micrometer)
    Prometheus
    Ignored
    Service
    [Eureka
    Service
    Discovery]

    View full-size slide

  19. Spring Cloud New Stack
    Should you make the change?

    View full-size slide

  20. Possible Issues

    View full-size slide

  21. Check out master and old-stack branches
    Demo Code

    View full-size slide

  22. Check out our projects

    View full-size slide

  23. Transforming How The World Builds Software
    © Copyright 2019 Pivotal Software, Inc. All rights Reserved.

    View full-size slide