Spring Cloud FunctionSpring Cloud Function4.2.0

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

Blogs

Spring Initializr

Quickstart Your Project

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all