close

Spring Cloud Function

3.2.6

Spring Cloud Function is a project with the following high-level goals:

  • Promote the implementation of business logic via functions.

  • Decouple the development lifecycle of business logic from any specific runtime target so that the same code can run as a web endpoint, a stream processor, or a task.

  • Support a uniform programming model across serverless providers, as well as the ability to run standalone (locally or in a PaaS).

  • Enable Spring Boot features (auto-configuration, dependency injection, metrics) on serverless providers.

It abstracts away all of the transport details and infrastructure, allowing the developer to keep all the familiar tools and processes, and focus firmly on business logic.

Features

Spring Cloud Function features:

  • Choice of programming styles - reactive, imperative or hybrid.

  • POJO functions (i.e., if something fits the @FunctionalInterface semantics we’ll treat it as function)

  • Transparent type conversion of inputs and outputs.

  • Function composition which includes composing imperative functions with reactive.

  • REST support to expose functions as HTTP endpoints etc.

  • Streaming data (via Apache Kafka, Solace, RabbitMQ and more) to/from functions via Spring Cloud Stream framework.

  • Deploying functions packaged as JAR files with an isolated classloader, to support multi-version deployments in a single JVM.

  • Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)

  • Adapters for AWS Lambda, Microsoft Azure, Apache OpenWhisk and possibly other "serverless" service providers.

  • Support for reactive function with multiple inputs and outputs allowing merging, joining and other complex streaming operation to be handled by functions.

Here’s a complete, executable, testable Spring Boot application (implementing a simple string manipulation):

@SpringBootApplication
public class Application {
  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

  @Bean
  public Function<String, String> uppercase() {
    return value -> value.toUpperCase();
  }
}

GitHub

Artifacts & Samples

Artifacts for various modules of spring-cloud-function available in Maven Central repository under spring-cloud-function-*. At the very least you would need spring-cloud-function-context module.

You can also try our samples available in project GitHub’s repository

Talk to us

If you wish to contribute you can pick any issue that is currently listed or simply submit a PR with functionality that you believe would benefit the project. You can also look for issues with ideal-for-contribution label.

Sample Projects and Community Contributions

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.

Documentation

Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
3.2.6 CURRENT GA Reference Doc. API Doc.
4.0.0-M3 PRE Reference Doc. API Doc.
3.2.6-SNAPSHOT SNAPSHOT Reference Doc. API Doc.
3.1.7 GA Reference Doc. API Doc.
Branch Initial Release End of Support End Commercial Support *
3.2.x
2021-11-30 2022-11-30 2024-03-30
3.1.x
2020-12-21 2021-12-21 2023-04-21
3.0.x
2019-11-22 2020-11-22 2022-03-22

OSS support

Free security updates and bugfixes with support from the Spring community. See VMware Tanzu OSS support policy.

Commercial support

Business support from Spring experts during the OSS timeline, plus extended support after OSS End-Of-Life.
Publicly available releases for critical bugfixes and security issues when requested by customers.

Future release

Generation not yet released, timeline is subject to changes.

About commercial support (*)

This page shows the current state of project releases and does not define the commercial support policy. Please refer to the official support policy for more information.