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

What's new in Spring Cloud?

What's new in Spring Cloud?

Enhanced support for Kotlin, support for Cloud Events, gRPC and RSocket, major enhancements in AWS Lambda support, streaming solutions, and more – a lot of work has gone into Spring Cloud Function in the last year. And what about Spring Cloud Sleuth and the whole observability story? Is there a Spring Cloud Sleuth integration for OkHttp? What declarative HTTP client can you use with WebClient for elegant HTTP calls? How can you easily route between multiple RSocket service instances? What about Spring Cloud Gateway? How can you effortlessly integrate your HTTP-based service with newer services that communicate with RSocket using Spring Cloud Gateway? Does Gateway support GRPC or HTTP2? And, of course, can any of this tech be run as native images?

Questions abound, so, in this ”state of the union” session, Olga and Oleg will answer some of them by going over the noteworthy features of various spring-cloud projects, showing how they can be used to solve real problems faced by users.

Olga Maciaszek-Sharma

May 27, 2022
Tweet

More Decks by Olga Maciaszek-Sharma

Other Decks in Technology

Transcript

  1. Oleg Zhurakousky
    Olga Maciaszek-Sharma
    What’s new in Spring Cloud?
    Copyright © 2020 VMware, Inc. or its affiliates.

    View Slide

  2. Oleg Zhurakousky
    Twitter: @z_oleg
    Olga Maciaszek-Sharma
    Twitter: @olga_maciaszek

    View Slide

  3. Safe Harbor Statement
    The following is intended to outline the general direction of Pivotal's offerings. It is intended for information
    purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal
    offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is
    subject to change. This information is provided without warranty or any kind, express or implied, and is not a
    commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing
    decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently
    available. The development, release, and timing of any features or functionality described for Pivotal's offerings
    in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking
    information in this presentation.
    © 2020 Spring. A VMware-backed project.

    View Slide

  4. Spring Cloud Square
    Spring Boot and Spring Cloud integrations for Retrofit and OkHttp.
    ● WebClient support for Retrofit interface clients
    ● Auto-configurations for Retrofit and OkHttp
    ● Load-balancing
    ● Tracing for OkHttp
    ● Only Retrofit annotations
    ● Incubator project
    ● Maintenance timeline - 2021.x release train

    View Slide

  5. Spring Cloud Square

    View Slide

  6. Spring interface clients
    Interface clients for within Spring Framework.
    ● A first-class solution in Framework replacing third-party integrations
    ● HTTP already present in Spring 6 milestones
    ○ HttpServiceProxyFactory , @HttpExchange annotation
    ○ Support for HttpMethod, @PathVariable, @RequestAttribute ,
    @RequestBody, @RequestHeader , @RequestParam
    ○ Support for both blocking and non-blocking mode
    ○ Planned multipart support
    ● Planned RSocket interface client

    View Slide

  7. Spring HTTP interface client

    View Slide

  8. Spring Cloud Observability
    Moving out of Spring Cloud Sleuth to Micrometer 1.10 and direct
    instrumentation in projects
    ● Micrometer 1.10 Tracing with Observation API
    ○ Observation
    ○ ObservationHandler
    ● Planned: tracing set-up by Spring Boot 3
    ● Spring Cloud Sleuth maintained for 2021.x

    View Slide

  9. Spring Cloud Observability - Observation

    View Slide

  10. Spring Cloud Observability - ObservationHandler

    View Slide

  11. RSocket
    Reactive Streams semantics on protocol level
    ● Message-driven, asynchronous
    ● No client/ server distinction once connection is made
    ● 4 modes
    ○ Fire and Forget
    ○ Request/ Response
    ○ Request/ Stream
    ○ Channel

    View Slide

  12. RSocket
    Reactive Streams semantics on protocol level
    ● Binary
    ● Flow control
    ○ Backpressure
    ○ Leasing
    ● Protocol support:
    ○ TCP
    ○ WebSockets
    ○ Aeron
    ○ HTTP/3 (QUIC)?

    View Slide

  13. RSocket support in Spring
    Support in spring-messaging
    ● RSocketRequester fluent API
    ● @MessageMapping and @ConnectMapping annotated responders

    View Slide

  14. RSocket support in Spring
    Support in spring-messaging
    ● MetadataExtractor

    View Slide

  15. RSocket Broker
    A specialized distributed broker for RSocket
    ● Service discovery
    ● Load-balancing
    ● Fault tolerance
    ● Security

    View Slide

  16. RSocket Broker
    RSocket
    Broker
    Service 1
    Service 3
    Service 2
    Service 3
    RSocket
    Broker
    RSocket
    Broker
    Service 1
    Service 2

    View Slide

  17. RSocket HTTP Bridge
    Seamless routing of HTTP requests through RSocket Broker
    ● POST requests
    ● serviceId and RSocket endpoint resolved from path
    ● Support for byte arrays and payload decoding
    ● RSocket Broker tags resolved from HTTP headers
    ● RSocket interaction mode resolved from URI or default configuration
    ● Support for RSocket Broker WellKnownKey
    ● Spring Cloud Gateway integration

    View Slide

  18. Demo

    View Slide

  19. Spring Native
    Support for GraalVM native images in Spring
    ● Initial support provided by the Spring Native project moving over to Spring 6
    ● Compatibility
    ● Native configuration files
    ● AOT plugin - AOT transformations

    View Slide

  20. Spring Cloud Native support
    Supported starters
    ● Spring Cloud Config Client
    ● Spring Cloud Config Server
    ● Spring Cloud Netflix Eureka Client
    ● Spring Cloud Sleuth
    ● Spring Cloud Function
    ● Spring Cloud Stream
    ● Spring Cloud Task
    ● Spring Cloud Sleuth Zipkin

    View Slide

  21. Spring Cloud Native support
    Planned support
    ● Spring Cloud Gateway
    ● Spring Cloud OpenFeign
    ● Spring Cloud CircuitBreaker
    ● Spring Cloud Kubernetes
    ● Spring Cloud LoadBalancer

    View Slide

  22. Spring Cloud Function
    Exposes Java Functions as Spring’s managed components
    ● Promotes implementation of business logic as functions
    ○ Supplier,
    ○ Function,
    ○ Consumer
    ● Function Composition
    ● Transparent Type conversion
    ● POJO Functions
    ● Reactive Support
    ● Deployment of packaged functions
    ● Adapters to serverless platforms

    View Slide

  23. Demo

    View Slide

  24. Spring Cloud Function Adapters
    Extensions to expose java functions to different invocation models
    ● AWS Lambda
    ● HTTP
    ● gRPC
    ● RSocket
    ● Azure
    ● Google Functions
    ● CloudEvent

    View Slide

  25. Spring Cloud Function Adapters - gRPC
    Exposes user functions via gRPC
    ● Supports two operation modes - client & server
    ● 4 interaction modes (request/reply, server/client/bidirectional-streaming)
    ● Pluggable protobuf extension OR
    ● Message centric

    View Slide

  26. Demo

    View Slide

  27. Spring Cloud Function Adapters - RSocket
    Exposes user functions as RSocket endpoints
    ● Supports all 4 RSocket invocation models
    ○ Fire and Forget
    ○ Request/ Response
    ○ Request/ Stream
    ○ Channel

    View Slide

  28. Demo

    View Slide

  29. Spring Cloud Function Adapters - AWS Lambda
    ● Provides ability to represent simple Java Functions as AWS Lambda
    ● Supports many event types
    ● Custom Runtime
    ● GraalVM support via Spring Native

    View Slide

  30. Demo

    View Slide

  31. Spring Cloud Stream
    Event stream processing (ESP) is the practice of taking
    action on a series of data points that originate from a
    system that continuously creates data.
    https://hazelcast.com/glossary/event-stream-processing/

    View Slide

  32. Spring Cloud Stream
    Framework to enable “event stream processing”
    applications - microservices
    ● Spring Boot driven
    ● Connects Messaging Brokers with user code using Destination Binders
    ● Core features
    ○ Partitioning
    ○ Consumer Groups
    ○ Message Headers
    ○ Destination provisioning
    ● Message centric
    ● Spring Cloud Function as programming model

    View Slide

  33. Spring Cloud Stream
    What’s new
    ● Native support
    ● StreamBridge
    ● Mono Repo
    ● Reactive Kafka Binder
    ● Complete removal of annotation-based programming model

    View Slide

  34. Demo

    View Slide

  35. Resources
    ● Demo code
    ● Spring Cloud Square
    ● Spring HTTP interface clients
    ● Micrometer Tracing
    ● RSocket
    ● Spring support for RSocket
    ● RSocket Broker
    ● RSocket HTTP Bridge

    View Slide

  36. Thank you
    © 2020 Spring. A VMware-backed project.

    View Slide