diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index e65ee4533..000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-# EditorConfig is awesome: https://EditorConfig.org
-
-# top-most EditorConfig file
-root = true
-
-[*]
-indent_style = tab
-indent_size = 4
-end_of_line = lf
-insert_final_newline = true
-
-[*.yml]
-indent_style = space
-indent_size = 2
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index d3204a48c..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: waiting-for-triage
-assignees: ''
-
----
-
-**Describe the bug**
-Please provide details of the problem, including the version of Spring Cloud that you
-are using.
-
-**Sample**
-If possible, please provide a test case or sample application that reproduces
-the problem. This makes it much easier for us to diagnose the problem and to verify that
-we have fixed it.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index b2e33c5fa..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: waiting-for-triage
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
\ No newline at end of file
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 000000000..f468738cf
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,53 @@
+name: Deploy Docs
+run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
+on:
+ workflow_dispatch:
+ inputs:
+ build-refname:
+ description: Enter git refname to build (e.g., 5.7.x).
+ required: false
+ push:
+ branches: docs-build
+env:
+ GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
+permissions:
+ contents: write
+jobs:
+ build:
+ if: github.repository_owner == 'spring-cloud'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 5
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: Set up refname build
+ if: github.event.inputs.build-refname
+ run: |
+ git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
+ export BUILD_REFNAME=${{ github.event.inputs.build-refname }}
+ echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV
+ export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")
+ echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV
+ - name: Run Antora
+ run: |
+ ./mvnw --no-transfer-progress -B antora -Pdocs
+ - name: Publish Docs
+ uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.13
+ with:
+ docs-username: ${{ secrets.DOCS_USERNAME }}
+ docs-host: ${{ secrets.DOCS_HOST }}
+ docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
+ docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ site-path: target/antora/site
+ - name: Bust Cloudflare Cache
+ uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11
+ with:
+ context-root: spring-cloud-function
+ cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
+ cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 51bb91bbc..64ce0fa6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,32 +1,23 @@
-/application.yml
-/application.properties
-asciidoctor.css
-*~
-.#*
-*#
target/
-build/
-bin/
-.sts4-cache/
-.attach_pid*
-.m2/
-.gradle/
-_site/
-.vscode/
-.classpath
-.project
.settings/
+.project
+.classpath
+*.orig
.springBeans
+.factorypath
+.sts4-cache
+.ant-targets-build.xml
+src/ant/.ant-targets-upload-dist.xml
+*.sonar4clipse*
.DS_Store
-*.sw*
*.iml
*.ipr
*.iws
-.idea/
-.factorypath
-.checkstyle
-coverage-error.log
-.apt_generated
-credentials.yml
-.flattened-pom.xml
-pom.xml.versionsBackup
+/.idea/
+*.graphml
+node
+node_modules
+build
+docs/package.json
+package-lock.json
+.flattened-pom.xml
\ No newline at end of file
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index 52b2013a8..0e7dabeff 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -1 +1 @@
--Xmx1024m -XX:CICompilerCount=1 -noverify -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
\ No newline at end of file
+-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
\ No newline at end of file
diff --git a/.mvn/maven.config b/.mvn/maven.config
deleted file mode 100644
index 3b8cf46e1..000000000
--- a/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
--DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
diff --git a/.mvn/settings.xml b/.mvn/settings.xml
deleted file mode 100644
index 2e2841999..000000000
--- a/.mvn/settings.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- sonatype-nexus-staging
- ${env.sonatype_username}
- ${env.sonatype_password}
-
-
- repo.spring.io
- ${env.spring_username}
- ${env.spring_password}
-
-
-
diff --git a/.springformat b/.springformat
deleted file mode 100644
index e69de29bb..000000000
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 9e59b8e23..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: java
-jdk:
- - oraclejdk8
-sudo: required
-cache:
- directories:
- - $HOME/.m2
-install: true
-before_script: ./mvnw install -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
-script: ./mvnw install -q -nsu -Dmaven.test.redirectTestOutputToFile=true
-dist: trusty
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc
deleted file mode 100644
index 8e009c69d..000000000
--- a/CONTRIBUTING.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-If you have not previously done so, please fill out and
-submit the https://cla.pivotal.io/sign/spring[Contributor License Agreement].
-
diff --git a/Guardfile b/Guardfile
deleted file mode 100644
index da91d82bb..000000000
--- a/Guardfile
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'asciidoctor'
-require 'erb'
-require './src/main/ruby/readme.rb'
-
-options = {:mkdirs => true, :safe => :unsafe, :attributes => ['linkcss', 'allow-uri-read']}
-
-guard 'shell' do
- watch(/^src\/[A-Z-a-z][^#]*\.adoc$/) {|m|
- SpringCloud::Build.render_file('src/main/asciidoc/README.adoc', :to_file => './README.adoc')
- Asciidoctor.render_file('src/main/asciidoc/spring-cloud-cli.adoc', options.merge(:to_dir => 'target/generated-docs'))
- }
-end
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 62589edd1..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/README.adoc b/README.adoc
index 139cdf601..e15e4f9f2 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,411 +1,23 @@
-////
-DO NOT EDIT THIS FILE. IT WAS GENERATED.
-Manual changes to this file will be lost when it is generated again.
-Edit the files in the src/main/asciidoc/ directory instead.
-////
+= Spring Cloud Function Docs Build
+You're currently viewing the Antora playbook branch.
+The playbook branch hosts the docs build that is used to build and publish the production docs site.
-:branch: master
+The Spring Cloud Function reference docs are built using https://antora.org[Antora].
+This README covers how to build the docs in a software branch as well as how to build the production docs site locally.
-image::https://travis-ci.org/spring-cloud/spring-cloud-function.svg?branch={branch}[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-function]
+== Building the Site
-== Introduction
-
-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.
-
-Here's a complete, executable, testable Spring Boot application
-(implementing a simple string manipulation):
-
-[source,java]
-----
-@SpringBootApplication
-public class Application {
-
- @Bean
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-}
-----
-
-It's just a Spring Boot application, so it can be built, run and
-tested, locally and in a CI build, the same way as any other Spring
-Boot application. The `Function` is from `java.util` and `Flux` is a
-https://www.reactive-streams.org/[Reactive Streams] `Publisher` from
-https://projectreactor.io/[Project Reactor]. The function can be
-accessed over HTTP or messaging.
-
-Spring Cloud Function has the following features:
-
-* _Choice of programming styles - reactive, imperative or hybrid._
-* _Function composition and adaptation (e.g., composing imperative functions with reactive)._
-* _Support for reactive function with multiple inputs and outputs allowing merging, joining and other complex streaming operation to be handled by functions._
-* _Transparent type conversion of inputs and outputs._
-* _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_
-* _Adapters to expose function to the outside world as HTTP endpoints etc._
-* _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._
-* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._
-
-== Getting Started
-
-Build from the command line (and "install" the samples):
-
-----
-$ ./mvnw clean install
-----
-
-(If you like to YOLO add `-DskipTests`.)
-
-Run one of the samples, e.g.
-
-----
-$ java -jar spring-cloud-function-samples/function-sample/target/*.jar
-----
-
-This runs the app and exposes its functions over HTTP, so you can
-convert a string to uppercase, like this:
-
-----
-$ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d Hello
-HELLO
-----
-
-You can convert multiple strings (a `Flux`) by separating them
-with new lines
+You can build the entire site by invoking the following on the docs-build branch and then viewing the site at `target/site/index.html`
+[source,bash]
----
-$ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d 'Hello
-> World'
-HELLOWORLD
+./mvnw antora
----
-(You can use `^Q^J` in a terminal to insert a new line in a literal
-string like that.)
-
-== Building
-
-:jdkversion: 17
-
-=== Basic Compile and Test
-
-To build the source you will need to install JDK {jdkversion}.
-
-Spring Cloud uses Maven for most build-related activities, and you
-should be able to get off the ground quite quickly by cloning the
-project you are interested in and typing
+== Building a Specific Branch
+[source,bash]
----
-$ ./mvnw install
+./mvnw antora
----
-
-NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
-in place of `./mvnw` in the examples below. If you do that you also
-might need to add `-P spring` if your local Maven settings do not
-contain repository declarations for spring pre-release artifacts.
-
-NOTE: Be aware that you might need to increase the amount of memory
-available to Maven by setting a `MAVEN_OPTS` environment variable with
-a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
-the `.mvn` configuration, so if you find you have to do it to make a
-build succeed, please raise a ticket to get the settings added to
-source control.
-
-The projects that require middleware (i.e. Redis) for testing generally
-require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
-
-
-=== Documentation
-
-The spring-cloud-build module has a "docs" profile, and if you switch
-that on it will try to build asciidoc sources from
-`src/main/asciidoc`. As part of that process it will look for a
-`README.adoc` and process it by loading all the includes, but not
-parsing or rendering it, just copying it to `${main.basedir}`
-(defaults to `${basedir}`, i.e. the root of the project). If there are
-any changes in the README it will then show up after a Maven build as
-a modified file in the correct place. Just commit it and push the change.
-
-=== Working with the code
-If you don't have an IDE preference we would recommend that you use
-https://www.springsource.com/developer/sts[Spring Tools Suite] or
-https://eclipse.org[Eclipse] when working with the code. We use the
-https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
-should also work without issue as long as they use Maven 3.3.3 or better.
-
-==== Activate the Spring Maven profile
-Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
-the spring milestone and snapshot repositories. Use your preferred IDE to set this
-profile to be active, or you may experience build errors.
-
-==== Importing into eclipse with m2eclipse
-We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
-eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
-marketplace".
-
-NOTE: Older versions of m2e do not support Maven 3.3, so once the
-projects are imported into Eclipse you will also need to tell
-m2eclipse to use the right profile for the projects. If you
-see many different errors related to the POMs in the projects, check
-that you have an up to date installation. If you can't upgrade m2e,
-add the "spring" profile to your `settings.xml`. Alternatively you can
-copy the repository settings from the "spring" profile of the parent
-pom into your `settings.xml`.
-
-==== Importing into eclipse without m2eclipse
-If you prefer not to use m2eclipse you can generate eclipse project metadata using the
-following command:
-
-[indent=0]
-----
- $ ./mvnw eclipse:eclipse
-----
-
-The generated eclipse projects can be imported by selecting `import existing projects`
-from the `file` menu.
-
-
-== Contributing
-
-:spring-cloud-build-branch: master
-
-Spring Cloud is released under the non-restrictive Apache 2.0 license,
-and follows a very standard Github development process, using Github
-tracker for issues and merging pull requests into master. If you want
-to contribute even something trivial please do not hesitate, but
-follow the guidelines below.
-
-=== Sign the Contributor License Agreement
-Before we accept a non-trivial patch or pull request we will need you to sign the
-https://cla.pivotal.io/sign/spring[Contributor License Agreement].
-Signing the contributor's agreement does not grant anyone commit rights to the main
-repository, but it does mean that we can accept your contributions, and you will get an
-author credit if we do. Active contributors might be asked to join the core team, and
-given the ability to merge pull requests.
-
-=== Code of Conduct
-This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
-conduct]. By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-=== Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
- Cloud Build] project. If using IntelliJ, you can use the
- https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
- Plugin] to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, and preferably at least a paragraph on what the class is
- for.
-* Add the ASF license header comment to all new `.java` files (copy from existing files
- in the project)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* If no-one else is using your branch, please rebase it against the current master (or
- other target branch in the main project).
-* When writing a commit message please follow https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
-
-=== Checkstyle
-
-Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- └── checkstyle.xml <1>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-
-==== Checkstyle configuration
-
-Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
-
-.pom.xml
-----
-
-true <1>
- true
- <2>
- true
- <3>
-
-
-
-
- <4>
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-----
-<1> Fails the build upon Checkstyle errors
-<2> Fails the build upon Checkstyle violations
-<3> Checkstyle analyzes also the test sources
-<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
-<5> Add checkstyle plugin to your build and reporting phases
-
-If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
-
-.projectRoot/src/checkstyle/checkstyle-suppresions.xml
-----
-
-
-
-
-
-
-----
-
-It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
-
-```bash
-$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat
-```
-
-=== IDE setup
-
-==== Intellij IDEA
-
-In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
-The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- ├── checkstyle.xml <1>
- └── intellij
- ├── Intellij_Project_Defaults.xml <4>
- └── Intellij_Spring_Boot_Java_Conventions.xml <5>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-<4> Project defaults for Intellij that apply most of Checkstyle rules
-<5> Project style conventions for Intellij that apply most of Checkstyle rules
-
-.Code style
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
-
-.Inspection profiles
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
-
-.Checkstyle
-
-To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
-
-Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
-
-- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
-- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
-- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
-
-IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
-
-=== Duplicate Finder
-
-Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
-
-==== Duplicate Finder configuration
-
-Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
-
-.pom.xml
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
-
-----
-
-For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
-
-You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
-
-If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
-
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
- org.joda.time.base.BaseDateTime
- .*module-info
-
-
- changelog.txt
-
-
-
-
-
-
-
-----
-
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 36ef17ca6..000000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,8 +0,0 @@
-**Describe the bug**
-Please provide details of the problem, including the version of Spring Cloud that you
-are using.
-
-**Sample**
-If possible, please provide a test case or sample application that reproduces
-the problem. This makes it much easier for us to diagnose the problem and to verify that
-we have fixed it.
diff --git a/antora-playbook.yml b/antora-playbook.yml
new file mode 100644
index 000000000..863595b87
--- /dev/null
+++ b/antora-playbook.yml
@@ -0,0 +1,39 @@
+antora:
+ extensions:
+ - require: '@springio/antora-extensions'
+ root_component_name: 'cloud-function'
+site:
+ title: Spring Cloud Function
+ url: https://docs.spring.io/spring-cloud-function/reference
+ robots: allow
+git:
+ ensure_git_suffix: false
+content:
+ sources:
+ - url: https://github.com/spring-cloud/spring-cloud-function
+ # Refname matching:
+ # https://docs.antora.org/antora/latest/playbook/content-refname-matching/
+ branches: [ main, 4.3.x, 4.2.x ]
+ tags: [ 'v{4..9}.+({0..9}).+({0..9})?(-{RC,M}*)', '!v4.1.0-M1', '!v4.0.*' ]
+ start_path: docs
+asciidoc:
+ attributes:
+ page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
+ page-pagination: ''
+ hide-uri-scheme: '@'
+ tabs-sync-option: '@'
+ extensions:
+ - '@asciidoctor/tabs'
+ - '@springio/asciidoctor-extensions'
+urls:
+ latest_version_segment_strategy: redirect:to
+ latest_version_segment: ''
+ redirect_facility: httpd
+ui:
+ bundle:
+ url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.18/ui-bundle.zip
+ snapshot: true
+runtime:
+ log:
+ failure_level: warn
+ format: pretty
diff --git a/docs/pom.xml b/docs/pom.xml
deleted file mode 100644
index 35f1d5e4a..000000000
--- a/docs/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
- 4.0.0
- spring-cloud-function-docs
-
- org.springframework.cloud
- spring-cloud-function-parent
- 4.1.0-SNAPSHOT
-
- pom
- Spring Cloud Function Docs
- Spring Cloud Function Docs
-
- spring-cloud-function
- ${basedir}/..
- 3.4
- deploy
-
-
-
- docs
-
-
-
- pl.project13.maven
- git-commit-id-plugin
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- org.apache.maven.plugins
- maven-resources-plugin
-
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
-
- ${project.version}
- ${spring-boot.version}
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- org.codehaus.mojo
- build-helper-maven-plugin
-
-
- maven-deploy-plugin
-
-
-
-
-
-
diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc
deleted file mode 100644
index 6d0f4cf8d..000000000
--- a/docs/src/main/asciidoc/README.adoc
+++ /dev/null
@@ -1,19 +0,0 @@
-:branch: master
-
-image::https://travis-ci.org/spring-cloud/spring-cloud-function.svg?branch={branch}[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-function]
-
-== Introduction
-
-include::_intro.adoc[]
-
-== Getting Started
-
-include::getting-started.adoc[]
-
-== Building
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building.adoc[]
-
-== Contributing
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
diff --git a/docs/src/main/asciidoc/_intro.adoc b/docs/src/main/asciidoc/_intro.adoc
deleted file mode 100644
index 76c97c73c..000000000
--- a/docs/src/main/asciidoc/_intro.adoc
+++ /dev/null
@@ -1,47 +0,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.
-
-Here's a complete, executable, testable Spring Boot application
-(implementing a simple string manipulation):
-
-[source,java]
-----
-@SpringBootApplication
-public class Application {
-
- @Bean
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-}
-----
-
-It's just a Spring Boot application, so it can be built, run and
-tested, locally and in a CI build, the same way as any other Spring
-Boot application. The `Function` is from `java.util` and `Flux` is a
-https://www.reactive-streams.org/[Reactive Streams] `Publisher` from
-https://projectreactor.io/[Project Reactor]. The function can be
-accessed over HTTP or messaging.
-
-Spring Cloud Function has the following features:
-
-* _Choice of programming styles - reactive, imperative or hybrid._
-* _Function composition and adaptation (e.g., composing imperative functions with reactive)._
-* _Support for reactive function with multiple inputs and outputs allowing merging, joining and other complex streaming operation to be handled by functions._
-* _Transparent type conversion of inputs and outputs._
-* _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_
-* _Adapters to expose function to the outside world as HTTP endpoints etc._
-* _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._
-* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._
diff --git a/docs/src/main/asciidoc/adapters/aws-intro.adoc b/docs/src/main/asciidoc/adapters/aws-intro.adoc
deleted file mode 100644
index 8bd82bb2f..000000000
--- a/docs/src/main/asciidoc/adapters/aws-intro.adoc
+++ /dev/null
@@ -1,318 +0,0 @@
-:branch: master
-
-=== AWS Lambda
-
-The https://aws.amazon.com/[AWS] adapter takes a Spring Cloud Function app and converts it to a form that can run in AWS Lambda.
-
-The details of how to get stared with AWS Lambda is out of scope of this document, so the expectation is that user has some familiarity with
-AWS and AWS Lambda and wants to learn what additional value spring provides.
-
-==== Getting Started
-
-One of the goals of Spring Cloud Function framework is to provide necessary infrastructure elements to enable a _simple function application_
-to interact in a certain way in a particular environment.
-A simple function application (in context or Spring) is an application that contains beans of type Supplier, Function or Consumer.
-So, with AWS it means that a simple function bean should somehow be recognised and executed in AWS Lambda environment.
-
-Let’s look at the example:
-
-[source, java]
-----
-@SpringBootApplication
-public class FunctionConfiguration {
-
- public static void main(String[] args) {
- SpringApplication.run(FunctionConfiguration.class, args);
- }
-
- @Bean
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-}
-----
-
-It shows a complete Spring Boot application with a function bean defined in it. What’s interesting is that on the surface this is just
-another boot app, but in the context of AWS Adapter it is also a perfectly valid AWS Lambda application. No other code or configuration
-is required. All you need to do is package it and deploy it, so let’s look how we can do that.
-
-To make things simpler we’ve provided a sample project ready to be built and deployed and you can access it
-https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws[here].
-
-You simply execute `./mvnw clean package` to generate JAR file. All the necessary maven plugins have already been setup to generate
-appropriate AWS deployable JAR file. (You can read more details about JAR layout in <>).
-
-Then you have to upload the JAR file (via AWS dashboard or AWS CLI) to AWS.
-
-When ask about _handler_ you specify `org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest` which is a generic request handler.
-
-image::{github-raw}/docs/src/main/asciidoc/images/AWS-deploy.png[width=800,scaledwidth="75%",align="center"]
-
-That is all. Save and execute the function with some sample data which for this function is expected to be a
-String which function will uppercase and return back.
-
-While `org.springframework.cloud.function.adapter.aws.FunctionInvoker` is a general purpose AWS's `RequestHandler` implementation aimed at completely
-isolating you from the specifics of AWS Lambda API, for some cases you may want to specify which specific AWS's `RequestHandler` you want
-to use. The next section will explain you how you can accomplish just that.
-
-
-==== AWS Request Handlers
-
-The adapter has a couple of generic request handlers that you can use. The most generic is (and the one we used in the Getting Started section)
-is `org.springframework.cloud.function.adapter.aws.FunctionInvoker` which is the implementation of AWS's `RequestStreamHandler`.
-User doesn't need to do anything other then specify it as 'handler' on AWS dashboard when deploying function.
-It will handle most of the case including Kinesis, streaming etc. .
-
-
-If your app has more than one `@Bean` of type `Function` etc. then you can choose the one to use by configuring `spring.cloud.function.definition`
-property or environment variable. The functions are extracted from the Spring Cloud `FunctionCatalog`. In the event you don't specify `spring.cloud.function.definition`
-the framework will attempt to find a default following the search order where it searches first for `Function` then `Consumer` and finally `Supplier`).
-
-
-==== AWS Function Routing
-
-One of the core features of Spring Cloud Function is https://docs.spring.io/spring-cloud-function/docs/{project-version}/reference/html/spring-cloud-function.html#_function_routing_and_filtering[routing]
-- an ability to have one special function to delegate to other functions based on the user provided routing instructions.
-
-In AWS Lambda environment this feature provides one additional benefit, as it allows you to bind a single function (Routing Function)
-as AWS Lambda and thus a single HTTP endpoint for API Gateway. So in the end you only manage one function and one endpoint, while benefiting
-from many function that can be part of your application.
-
-More details are available in the provided https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-aws-routing[sample],
-yet few general things worth mentioning.
-
-Routing capabilities will be enabled by default whenever there is more then one function in your application as `org.springframework.cloud.function.adapter.aws.FunctionInvoker`
-can not determine which function to bind as AWS Lambda, so it defaults to `RoutingFunction`.
-This means that all you need to do is provide routing instructions which you can do https://docs.spring.io/spring-cloud-function/docs/{project-version}/reference/html/spring-cloud-function.html#_function_routing_and_filtering[using several mechanisms]
-(see https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-aws-routing[sample] for more details).
-
-Also, note that since AWS does not allow dots `.` and/or hyphens`-` in the name of the environment variable, you can benefit from boot support and simply substitute
-dots with underscores and hyphens with camel case. So for example `spring.cloud.function.definition` becomes `spring_cloud_function_definition`
-and `spring.cloud.function.routing-expression` becomes `spring_cloud_function_routingExpression`.
-
-===== AWS Function Routing with Custom Runtime
-
-When using <> Function Routing works the same way. All you need is to specify `functionRouter` as AWS Handler the same way you would use the name of the function as handler.
-
-==== Notes on JAR Layout
-
-You don't need the Spring Cloud Function Web or Stream adapter at runtime in Lambda, so you might
-need to exclude those before you create the JAR you send to AWS. A Lambda application has to be
-shaded, but a Spring Boot standalone application does not, so you can run the same app using 2
-separate jars (as per the sample). The sample app creates 2 jar files, one with an `aws`
-classifier for deploying in Lambda, and one [[thin-jar,thin jar]] executable (thin) jar that includes `spring-cloud-function-web`
-at runtime. Spring Cloud Function will try and locate a "main class" for you from the JAR file
-manifest, using the `Start-Class` attribute (which will be added for you by the Spring Boot
-tooling if you use the starter parent). If there is no `Start-Class` in your manifest you can
-use an environment variable or system property `MAIN_CLASS` when you deploy the function to AWS.
-
-If you are not using the functional bean definitions but relying on Spring Boot's auto-configuration,
-and are not depending on `spring-boot-starter-parent`,
-then additional transformers must be configured as part of the maven-shade-plugin execution.
-
-[[shade-plugin-setup]]
-[source, xml]
-----
-
- org.apache.maven.plugins
- maven-shade-plugin
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- 2.7.4
-
-
-
-
-
- shade
-
-
- false
- true
- aws
-
-
- META-INF/spring.handlers
-
-
- META-INF/spring.factories
-
-
- META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
-
-
- META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports
-
-
- META-INF/spring.schemas
-
-
- META-INF/spring.components
-
-
-
-
-
-
-----
-
-==== Build file setup
-
-In order to run Spring Cloud Function applications on AWS Lambda, you can leverage Maven or Gradle
- plugins offered by the cloud platform provider.
-
-
-===== Maven
-
-In order to use the adapter plugin for Maven, add the plugin dependency to your `pom.xml`
-file:
-
-[source,xml]
-----
-
-
- org.springframework.cloud
- spring-cloud-function-adapter-aws
-
-
-----
-
-As pointed out in the <>, you will need a shaded jar in order to upload it
-to AWS Lambda. You can use the https://maven.apache.org/plugins/maven-shade-plugin/[Maven Shade Plugin] for that.
-The example of the <> can be found above.
-
-You can use the Spring Boot Maven Plugin to generate the <>.
-[source,xml]
-----
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.springframework.boot.experimental
- spring-boot-thin-layout
- ${wrapper.version}
-
-
-
-----
-
-You can find the entire sample `pom.xml` file for deploying Spring Cloud Function
-applications to AWS Lambda with Maven https://github.com/spring-cloud/spring-cloud-function/blob/{branch}/spring-cloud-function-samples/function-sample-aws/pom.xml[here].
-
-===== Gradle
-
-In order to use the adapter plugin for Gradle, add the dependency to your `build.gradle` file:
-
-[source,groovy]
-----
-
-dependencies {
- compile("org.springframework.cloud:spring-cloud-function-adapter-aws:${version}")
-}
-----
-
-As pointed out in <>, you will need a shaded jar in order to upload it
-to AWS Lambda. You can use the https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow/[Gradle Shadow Plugin] for that:
-
-[source,groovy]
-----
-buildscript {
- dependencies {
- classpath "com.github.jengelman.gradle.plugins:shadow:${shadowPluginVersion}"
- }
-}
-apply plugin: 'com.github.johnrengelman.shadow'
-
-assemble.dependsOn = [shadowJar]
-
-import com.github.jengelman.gradle.plugins.shadow.transformers.*
-
-shadowJar {
- classifier = 'aws'
- dependencies {
- exclude(
- dependency("org.springframework.cloud:spring-cloud-function-web:${springCloudFunctionVersion}"))
- }
- // Required for Spring
- mergeServiceFiles()
- append 'META-INF/spring.handlers'
- append 'META-INF/spring.schemas'
- append 'META-INF/spring.tooling'
- append 'META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports'
- append 'META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports'
- transform(PropertiesFileTransformer) {
- paths = ['META-INF/spring.factories']
- mergeStrategy = "append"
- }
-}
-
-----
-
-You can use the Spring Boot Gradle Plugin and Spring Boot Thin Gradle Plugin to generate
-the <>.
-
-[source,groovy]
-----
-buildscript {
- dependencies {
- classpath("org.springframework.boot.experimental:spring-boot-thin-gradle-plugin:${wrapperVersion}")
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
- }
-}
-apply plugin: 'org.springframework.boot'
-apply plugin: 'org.springframework.boot.experimental.thin-launcher'
-assemble.dependsOn = [thinJar]
-----
-
-You can find the entire sample `build.gradle` file for deploying Spring Cloud Function
-applications to AWS Lambda with Gradle https://github.com/spring-cloud/spring-cloud-function/blob/{branch}/spring-cloud-function-samples/function-sample-aws/build.gradle[here].
-
-==== Upload
-
-Build the sample under `spring-cloud-function-samples/function-sample-aws` and upload the `-aws` jar file to Lambda. The handler can be `example.Handler` or `org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler` (FQN of the class, _not_ a method reference, although Lambda does accept method references).
-
-----
-./mvnw -U clean package
-----
-
-Using the AWS command line tools it looks like this:
-
-----
-aws lambda create-function --function-name Uppercase --role arn:aws:iam::[USERID]:role/service-role/[ROLE] --zip-file fileb://function-sample-aws/target/function-sample-aws-2.0.0.BUILD-SNAPSHOT-aws.jar --handler org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler --description "Spring Cloud Function Adapter Example" --runtime java8 --region us-east-1 --timeout 30 --memory-size 1024 --publish
-----
-
-The input type for the function in the AWS sample is a Foo with a single property called "value". So you would need this to test it:
-
-----
-{
- "value": "test"
-}
-----
-
-NOTE: The AWS sample app is written in the "functional" style (as an `ApplicationContextInitializer`). This is much faster on startup in Lambda than the traditional `@Bean` style, so if you don't need `@Beans` (or `@EnableAutoConfiguration`) it's a good choice. Warm starts are not affected.
-
-
-==== Type Conversion
-
-Spring Cloud Function will attempt to transparently handle type conversion between the raw
-input stream and types declared by your function.
-
-For example, if your function signature is as such `Function` we will attempt to convert
-incoming stream event to an instance of `Foo`.
-
-In the event type is not known or can not be determined (e.g., `Function, ?>`) we will attempt to
-convert an incoming stream event to a generic `Map`.
-
-====== Raw Input
-
-There are times when you may want to have access to a raw input. In this case all you need is to declare your
-function signature to accept `InputStream`. For example, `Function`. In this case
-we will not attempt any conversion and will pass the raw input directly to a function.
-
-
-
-
-
diff --git a/docs/src/main/asciidoc/adapters/aws.adoc b/docs/src/main/asciidoc/adapters/aws.adoc
deleted file mode 100644
index 0912ded38..000000000
--- a/docs/src/main/asciidoc/adapters/aws.adoc
+++ /dev/null
@@ -1,95 +0,0 @@
-*{project-version}*
-
-
-The https://aws.amazon.com/[AWS] adapter takes a Spring Cloud Function app and converts it to a form that can run in AWS Lambda.
-
-== Introduction
-
-include::adapters/aws-intro.adoc[]
-
-== Functional Bean Definitions
-
-Your functions will start much quicker if you can use functional bean definitions instead of `@Bean`. To do this make your main class
-an `ApplicationContextInitializer` and use the `registerBean()` methods in `GenericApplicationContext` to
-create all the beans you need. You function need to be registered as a bean of type `FunctionRegistration` so that the input and
-output types can be accessed by the framework. There is an example in github (the AWS sample is written in this style). It would
-look something like this:
-
-```java
-@SpringBootConfiguration
-public class FuncApplication implements ApplicationContextInitializer {
-
- public static void main(String[] args) throws Exception {
- FunctionalSpringApplication.run(FuncApplication.class, args);
- }
-
- public Function function() {
- return value -> new Bar(value.uppercase()));
- }
-
- @Override
- public void initialize(GenericApplicationContext context) {
- context.registerBean("function", FunctionRegistration.class,
- () -> new FunctionRegistration>(function())
- .type(FunctionTypeUtils.functionType(Foo.class, Bar.class)));
- }
-
-}
-```
-
-== AWS Context
-
-In a typical implementation of AWS Handler user has access to AWS _context_ object. With function approach you can have the same experience if you need it.
-Upon each invocation the framework will add `aws-context` message header containing the AWS _context_ instance for that particular invocation. So if you need to access it
-you can simply have `Message` as an input parameter to your function and then access `aws-context` from message headers.
-For convenience we provide AWSLambdaUtils.AWS_CONTEXT constant.
-
-== Platform Specific Features
-
-=== HTTP and API Gateway
-
-AWS has some platform-specific data types, including batching of messages, which is much more efficient than processing each one individually. To make use of these types you can write a function that depends on those types. Or you can rely on Spring to extract the data from the AWS types and convert it to a Spring `Message`. To do this you tell AWS that the function is of a specific generic handler type (depending on the AWS service) and provide a bean of type `Function,Message>`, where `S` and `T` are your business data types. If there is more than one bean of type `Function` you may also need to configure the Spring Boot property `function.name` to be the name of the target bean (e.g. use `FUNCTION_NAME` as an environment variable).
-
-The supported AWS services and generic handler types are listed below:
-
-|===
-| Service | AWS Types | Generic Handler |
-
-| API Gateway | `APIGatewayProxyRequestEvent`, `APIGatewayProxyResponseEvent` | `org.springframework.cloud.function.adapter.aws.SpringBootApiGatewayRequestHandler` |
-| Kinesis | KinesisEvent | org.springframework.cloud.function.adapter.aws.SpringBootKinesisEventHandler |
-|===
-
-
-For example, to deploy behind an API Gateway, use `--handler org.springframework.cloud.function.adapter.aws.SpringBootApiGatewayRequestHandler` in your AWS command line (in via the UI) and define a `@Bean` of type `Function,Message>` where `Foo` and `Bar` are POJO types (the data will be marshalled and unmarshalled by AWS using Jackson).
-
-== Custom Runtime
-
-You can also benefit from https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html[AWS Lambda custom runtime] feature of AWS Lambda
-and Spring Cloud Function provides all the necessary components to make it easy.
-
-From the code perspective the application should look no different then any other Spring Cloud Function application.
-The only thing you need to do is to provide a `bootstrap` script in the root of your zip/jar that runs the Spring Boot application.
-and select "Custom Runtime" when creating a function in AWS.
-Here is an example 'bootstrap' file:
-```text
-#!/bin/sh
-
-cd ${LAMBDA_TASK_ROOT:-.}
-
-java -Dspring.main.web-application-type=none -Dspring.jmx.enabled=false \
- -noverify -XX:TieredStopAtLevel=1 -Xss256K -XX:MaxMetaspaceSize=128M \
- -Djava.security.egd=file:/dev/./urandom \
- -cp .:`echo lib/*.jar | tr ' ' :` com.example.LambdaApplication
-```
-The `com.example.LambdaApplication` represents your application which contains function beans.
-
-Set the handler name in AWS to the name of your function. You can use function composition here as well (e.g., `uppecrase|reverse`).
-That is pretty much all. Once you upload your zip/jar to AWS your function will run in custom runtime.
-We provide a https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws-custom-new[sample project]
-where you can also see how to configure yoru POM to properly generate the zip file.
-
-The functional bean definition style works for custom runtimes as well, and is
-faster than the `@Bean` style. A custom runtime can start up much quicker even than a functional bean implementation
-of a Java lambda - it depends mostly on the number of classes you need to load at runtime.
-Spring doesn't do very much here, so you can reduce the cold start time by only using primitive types in your function, for instance,
-and not doing any work in custom `@PostConstruct` initializers.
diff --git a/docs/src/main/asciidoc/adapters/azure-intro.adoc b/docs/src/main/asciidoc/adapters/azure-intro.adoc
deleted file mode 100644
index 59ceca215..000000000
--- a/docs/src/main/asciidoc/adapters/azure-intro.adoc
+++ /dev/null
@@ -1,533 +0,0 @@
-:branch: master
-
-== Microsoft Azure Functions
-:sectnums:
-
-https://azure.microsoft.com[Azure] function adapter for deploying `Spring Cloud Function` applications as native Azure Java Functions.
-
-The `Azure Functions` https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java[programming model] relays, extensively, on Java https://learn.microsoft.com/en-us/java/api/com.microsoft.azure.functions.annotation?view=azure-java-stable[annotations] for defining the function's handler methods and their input and output types.
-At compile time the annotated classes are processed by the provided Azure Maven/Gradle plugins to generate the necessary Azure Function binding files, configurations and package artifacts.
-The Azure annotations are just a type-safe way to configure your java function to be recognized as Azure function.
-
-The https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[spring-cloud-function-adapter-azure] extends the basic programming model to provide Spring and Spring Cloud Function support.
-With the adapter you can build your Spring Cloud Function application using dependency injections and then auto-wire the necessary services into your Azure handler methods.
-
-image::../images/scf-azure-adapter.svg[width=800,scaledwidth="75%",align="center"]
-
-TIP: For Web-based function applications, you can replace the generic `adapter-azure` with the specialized https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web[spring-cloud-function-adapter-azure-web].
-With the Azure Web Adapter you can deploy any Spring Web application as an Azure, HttpTrigger, function.
-This adapter hides the Azure annotations complexity and uses the familiar https://docs.spring.io/spring-boot/docs/current/reference/html/web.html[Spring Web] programming model instead.
-For further information follow the <> section below.
-
-== Azure Adapter
-
-Provides `Spring` & `Spring Cloud Function` integration for Azure Functions.
-
-=== Dependencies
-
-In order to enable the Azure Function integration add the azure adapter dependency to your `pom.xml` or `build.gradle`
-files:
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
- org.springframework.cloud
- spring-cloud-function-adapter-azure
-
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-function-adapter-azure'
-}
-----
-====
-
-NOTE: version `4.0.0+` is required. Having the adapter on the classpath activates the Azure Java Worker integration.
-
-[[azure.development.guidelines]]
-=== Development Guidelines
-
-Use the `@Component` (or `@Service`) annotation to turn any exiting Azure Function class (e.g. with `@FunctionName` handlers) into a Spring component.
-Then you can auto-wire the required dependencies (or the <> for Spring Cloud Function composition) and use those inside the Azure function handlers.
-
-[source,java]
-----
-@Component // <1>
-public class MyAzureFunction {
-
- // Plain Spring bean - not a Spring Cloud Functions!
- @Autowired private Function uppercase; // <2>
-
- // The FunctionCatalog leverages the Spring Cloud Function framework.
- @Autowired private FunctionCatalog functionCatalog; // <2>
-
- @FunctionName("spring") // <3>
- public String plainBean( // <4>
- @HttpTrigger(name = "req", authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
- ExecutionContext context) {
-
- return this.uppercase.apply(request.getBody().get());
- }
-
- @FunctionName("scf") // <3>
- public String springCloudFunction( // <5>
- @HttpTrigger(name = "req", authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
- ExecutionContext context) {
-
- // Use SCF composition. Composed functions are not just spring beans but SCF such.
- Function composed = this.functionCatalog.lookup("reverse|uppercase"); // <6>
-
- return (String) composed.apply(request.getBody().get());
- }
-}
-----
-
-<1> Indicates that the `MyAzureFunction` class is a "component" to be considered by the Spring Framework as a candidate for auto-detection and classpath scanning.
-<2> Auto-wire the `uppercase` and `functionCatalog` beans defined in the `HttpTriggerDemoApplication` (below).
-<3> The https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#java-function-basics[@FunctionName] annotation identifies the designated Azure function handlers.
-When invoked by a trigger (such as `@HttpTrigger`), functions process that trigger, and any other inputs, to produce one or more outputs.
-<4> The `plainBean` method handler is mapped to an Azure function that uses of the auto-wired `uppercase` spring bean to compute the result.
-It demonstrates how to use "plain" Spring components in your Azure handlers.
-<5> The `springCloudFunction` method handler is mapped to another Azure function, that uses the auto-wired `FunctionCatalog` instance to compute the result.
-<6> Shows how to leverage the Spring Cloud Function <> composition API.
-
-TIP: Use the Java annotations included in the https://learn.microsoft.com/en-us/java/api/com.microsoft.azure.functions.annotation?view=azure-java-stable[com.microsoft.azure.functions.annotation.*] package to bind input and outputs to your methods.
-
-The implementation of the business logic used inside the Azure handlers looks like a common Spring application:
-
-[[HttpTriggerDemoApplication]]
-
-[source,java]
-----
-@SpringBootApplication // <1>
-public class HttpTriggerDemoApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(HttpTriggerDemoApplication.class, args);
- }
-
- @Bean
- public Function uppercase() { // <2>
- return payload -> payload.toUpperCase();
- }
-
- @Bean
- public Function reverse() { // <2>
- return payload -> new StringBuilder(payload).reverse().toString();
- }
-}
-----
-<1> The `@SpringBootApplication` annotated class is used as a `Main-Class` as explained in <>.
-<2> Functions auto-wired and used in the Azure function handlers.
-
-==== Function Catalog
-
-The Spring Cloud Function supports a range of type signatures for user-defined functions, while providing a consistent execution model.
-For this it uses the <> to transform all user defined functions into a canonical representation.
-
-The Azure adapter can auto-wire any Spring component, such as the `uppercase` above.
-But those are treated as plain Java class instances, not as a canonical Spring Cloud Functions!
-
-To leverage Spring Cloud Function and have access to the canonical function representations, you need to auto-wire the `FunctionCatalog` and use it in your handler, like the `functionCatalog` instance the `springCloudFunction()` handler above.
-
-==== Accessing Azure ExecutionContext
-
-Some time there is a need to access the target execution context provided by the Azure runtime in the form of `com.microsoft.azure.functions.ExecutionContext`.
-For example one of such needs is logging, so it can appear in the Azure console.
-
-For that purpose the `AzureFunctionUtil.enhanceInputIfNecessary` allow you to add an instance of the `ExecutionContext` as a Message header so you can retrieve it via `executionContext` key.
-
-[source,java]
-----
-@FunctionName("myfunction")
-public String execute(
- @HttpTrigger(name = "req", authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
- ExecutionContext context) {
-
- Message message =
- (Message) AzureFunctionUtil.enhanceInputIfNecessary(request.getBody().get(), context); // <1>
-
- return this.uppercase.apply(message);
-}
-----
-<1> Leverages the `AzureFunctionUtil` utility to inline the `context` as message header using the `AzureFunctionUtil.EXECUTION_CONTEXT` header key.
-
-Now you can retrieve the ExecutionContext from message headers:
-
-[source,java]
-----
-@Bean
-public Function, String> uppercase(JsonMapper mapper) {
- return message -> {
- String value = message.getPayload();
- ExecutionContext context =
- (ExecutionContext) message.getHeaders().get(AzureFunctionUtil.EXECUTION_CONTEXT); // <1>
- . . .
- }
-}
-----
-<1> Retrieve the ExecutionContext instance from the header.
-
-
-[[azure.configuration]]
-=== Configuration
-
-To run your function applications on Microsoft Azure, you have to provide the necessary configurations, such as `function.json` and `host.json`, and adhere to the compulsory https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#folder-structure[packaging format].
-
-Usually the Azure Maven (or Gradle) plugins are used to generate the necessary configurations from the annotated classes and to produce the required package format.
-
-IMPORTANT: The Azure https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#folder-structure[packaging format] is not compatible with the default Spring Boot packaging (e.g. `uber jar`).
-The <> section below explains how to handle this.
-
-==== Azure Maven/Gradle Plugins
-
-Azure provides https://github.com/microsoft/azure-maven-plugins/tree/develop/azure-functions-maven-plugin[Maven] and https://github.com/microsoft/azure-gradle-plugins/tree/master/azure-functions-gradle-plugin[Gradle] plugins to process the annotated classes, generate the necessary configurations and produce the expected package layout.
-Plugins are used to set the platform, runtime and app-settings properties like this:
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
- com.microsoft.azure
- azure-functions-maven-plugin
- 1.22.0 or higher
-
-
- YOUR-AZURE-FUNCTION-APP-NAME
- YOUR-AZURE-FUNCTION-RESOURCE-GROUP
- YOUR-AZURE-FUNCTION-APP-REGION
- YOUR-AZURE-FUNCTION-APP-SERVICE-PLANE-NAME
- YOUR-AZURE-FUNCTION-PRICING-TIER
-
- ${project.basedir}/src/main/resources/host.json
-
-
- linux
- 11
-
-
-
-
- FUNCTIONS_EXTENSION_VERSION
- ~4
-
-
-
-
-
- package-functions
-
- package
-
-
-
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-plugins {
- id "com.microsoft.azure.azurefunctions" version "1.11.0"
- // ...
-}
-
-apply plugin: "com.microsoft.azure.azurefunctions"
-
-azurefunctions {
- appName = 'YOUR-AZURE-FUNCTION-APP-NAME'
- resourceGroup = 'YOUR-AZURE-FUNCTION-RESOURCE-GROUP'
- region = 'YOUR-AZURE-FUNCTION-APP-REGION'
- appServicePlanName = 'YOUR-AZURE-FUNCTION-APP-SERVICE-PLANE-NAME'
- pricingTier = 'YOUR-AZURE-FUNCTION-APP-SERVICE-PLANE-NAME'
-
- runtime {
- os = 'linux'
- javaVersion = '11'
- }
-
- auth {
- type = 'azure_cli'
- }
-
- appSettings {
- FUNCTIONS_EXTENSION_VERSION = '~4'
- }
- // Uncomment to enable local debug
- // localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
-}
-----
-====
-
-More information about the runtime configurations: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#java-versions[Java Versions], https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption#specify-the-deployment-os[Deployment OS].
-
-[[disable.spring.boot.plugin]]
-==== Disable Spring Boot Plugin
-
-Expectedly, the Azure Functions run inside the Azure execution runtime, not inside the SpringBoot runtime!
-Furthermore, Azure expects a specific packaging format, generated by the Azure Maven/Gradle plugins, that is not compatible with the default Spring Boot packaging.
-
-You have to either disable the SpringBoot Maven/Gradle plugin or use the https://github.com/dsyer/spring-boot-thin-launcher[Spring Boot Thin Launcher] as shown in this Maven snippet:
-
-[source,xml]
-----
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
- org.springframework.boot.experimental
- spring-boot-thin-layout
-
-
-
-----
-
-[[star-class-configuration]]
-==== Main-Class Configuration
-
-Specify the `Main-Class`/`Start-Class` to point to your Spring application entry point, such as the <> class in the example above.
-
-You can use the Maven `start-class` property or set the `Main-Class` attribute of your `MANIFEST/META-INFO`:
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
- YOUR APP MAIN CLASS
- ...
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-jar {
- manifest {
- attributes(
- "Main-Class": "YOUR-APP-MAIN-CLASS"
- )
- }
-}
-----
-====
-
-TIP: Alternatively you can use the `MAIN_CLASS` environment variable to set the class name explicitly.
-For local runs, add the `MAIN_CLASS` variable to your `local.settings.json` file and for Azure portal deployment set the variable in the https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#get-started-in-the-azure-portal[App Settings].
-
-
-IMPORTANT: If the `MAIN_CLASS` variable is not set, the Azure adapter lookups the `MANIFEST/META-INFO` attributes from the jars found on the classpath and selects the first `Main-Class:` annotated with either a `@SpringBootApplication` or `@SpringBootConfiguration` annotation.
-
-==== Metadata Configuration
-
-You can use a shared https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json[host.json] file to configure the function app.
-
-[source,json]
-----
-{
- "version": "2.0",
- "extensionBundle": {
- "id": "Microsoft.Azure.Functions.ExtensionBundle",
- "version": "[4.*, 5.0.0)"
- }
-}
-----
-
-The host.json metadata file contains configuration options that affect all functions in a function app instance.
-
-TIP: If the file is not in the project top folder you need to configure your plugins accordingly (like `hostJson` maven attribute).
-
-=== Samples
-
-Here is a list of various Spring Cloud Function Azure Adapter samples you can explore:
-
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-http-trigger[Http Trigger (Maven)]
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle[Http Trigger (Gradle)]
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-blob-trigger[Blob Trigger (Maven)]
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-timer-trigger[Timer Trigger (Maven)]
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-kafka-trigger[ Kafka Trigger & Output Binding (Maven)].
-
-[[azure.web.adapter]]
-== Azure Web Adapter
-
-For, pure, Web-based function applications, you can replace the generic `adapter-azure` with the specialized https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web[spring-cloud-function-adapter-azure-web].
-The Azure Web Adapter can deploy any Spring Web application as a native Azure function, using the HttpTrigger internally.
-It hides the Azure annotations complexity and relies on the familiar https://docs.spring.io/spring-boot/docs/current/reference/html/web.html[Spring Web] programming model instead.
-
-To enable the Azure Web Adapter, add the adapter dependency to your `pom.xml` or `build.gradle` files:
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
- org.springframework.cloud
- spring-cloud-function-adapter-azure-web
-
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencies {
- implementation 'org.springframework.cloud:spring-cloud-function-adapter-azure-web'
-}
-----
-====
-
-The same <> and <> instructions apply to the `Azure Web Adapter` as well.
-
-
-=== Samples
-
-For further information, explore the following, Azure Web Adapter, sample:
-
-- https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-web[ Azure Web Adapter (Maven)].
-
-[[azure.usage]]
-== Usage
-
-Common instructions for building and deploying both, `Azure Adapter` and `Azure Web Adapter` type of applications.
-
-=== Build
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-./mvnw -U clean package
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-./gradlew azureFunctionsPackage
-----
-====
-
-=== Running locally
-
-To run locally on top of `Azure Functions`, and to deploy to your live Azure environment, you will need `Azure Functions Core Tools` installed along with the Azure CLI (see https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-java?tabs=bash%2Cazure-cli%2Cbrowser#configure-your-local-environment[here]).
-For some configuration you would need the https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator[Azurite emulator] as well.
-
-Then run the sample:
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-./mvnw azure-functions:run
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-./gradlew azureFunctionsRun
-----
-====
-
-=== Running on Azure
-
-Make sure you are logged in your Azure account.
-
-----
-az login
-----
-
-and deploy
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-./mvnw azure-functions:deploy
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-./gradlew azureFunctionsDeploy
-----
-====
-
-=== Debug locally
-
-Run the function in debug mode.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-./mvnw azure-functions:run -DenableDebug
-----
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-
-----
-// If you want to debug your functions, please add the following line
-// to the azurefunctions section of your build.gradle.
-azurefunctions {
- ...
- localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
-}
-----
-====
-
-Alternatively and the `JAVA_OPTS` value to your `local.settings.json` like this:
-
-[source,json]
-----
-{
- "IsEncrypted": false,
- "Values": {
- ...
- "FUNCTIONS_WORKER_RUNTIME": "java",
- "JAVA_OPTS": "-Djava.net.preferIPv4Stack=true -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=127.0.0.1:5005"
- }
-}
-----
-
-Here is snippet for a `VSCode` remote debugging configuration:
-
-[source,json]
-----
-{
- "version": "0.2.0",
- "configurations": [
- {
- "type": "java",
- "name": "Attach to Remote Program",
- "request": "attach",
- "hostName": "localhost",
- "port": "5005"
- },
- ]
-}
-----
-
-== FunctionInvoker (deprecated)
-
-WARNING: The legacy `FunctionInvoker` programming model is deprecated and will not be supported going forward.
-
-For additional documentation and samples about the Function Integration approach follow the https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure/[azure-sample] README and code.
-
-== Relevant Links
-
-- https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/getting-started-with-spring-cloud-function-in-azure[Spring Cloud Function in Azure]
-- https://spring.io/blog/2023/02/24/spring-cloud-function-for-azure-function[Spring Cloud Function for Azure Function (blog)]
-- <>
-- https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-java?tabs=bash%2Cconsumption[Azure Functions Java developer guide]
-- https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob[Azure Functions developer guide]
-
-:sectnums!:
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/adapters/azure.adoc b/docs/src/main/asciidoc/adapters/azure.adoc
deleted file mode 100644
index 01dd586d4..000000000
--- a/docs/src/main/asciidoc/adapters/azure.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-*{project-version}*
-
-include::adapters/azure-intro.adoc[]
diff --git a/docs/src/main/asciidoc/adapters/gcp-intro.adoc b/docs/src/main/asciidoc/adapters/gcp-intro.adoc
deleted file mode 100644
index 1f72b19ed..000000000
--- a/docs/src/main/asciidoc/adapters/gcp-intro.adoc
+++ /dev/null
@@ -1,295 +0,0 @@
-:branch: master
-
-=== Google Cloud Functions
-
-The Google Cloud Functions adapter enables Spring Cloud Function apps to run on the https://cloud.google.com/functions[Google Cloud Functions] serverless platform.
-You can either run the function locally using the open source https://github.com/GoogleCloudPlatform/functions-framework-java[Google Functions Framework for Java] or on GCP.
-
-==== Project Dependencies
-
-Start by adding the `spring-cloud-function-adapter-gcp` dependency to your project.
-
-[source, xml]
-----
-
-
- org.springframework.cloud
- spring-cloud-function-adapter-gcp
-
-
- ...
-
-----
-
-In addition, add the `spring-boot-maven-plugin` which will build the JAR of the function to deploy.
-
-NOTE: Notice that we also reference `spring-cloud-function-adapter-gcp` as a dependency of the `spring-boot-maven-plugin`. This is necessary because it modifies the plugin to package your function in the correct JAR format for deployment on Google Cloud Functions.
-
-[source, xml]
-----
-
- org.springframework.boot
- spring-boot-maven-plugin
-
- target/deploy
-
-
-
- org.springframework.cloud
- spring-cloud-function-adapter-gcp
-
-
-
-----
-
-Finally, add the Maven plugin provided as part of the Google Functions Framework for Java.
-This allows you to test your functions locally via `mvn function:run`.
-
-NOTE: The function target should always be set to `org.springframework.cloud.function.adapter.gcp.GcfJarLauncher`; this is an adapter class which acts as the entry point to your Spring Cloud Function from the Google Cloud Functions platform.
-
-[source,xml]
-----
-
- com.google.cloud.functions
- function-maven-plugin
- 0.9.1
-
- org.springframework.cloud.function.adapter.gcp.GcfJarLauncher
- 8080
-
-
-----
-
-A full example of a working `pom.xml` can be found in the https://github.com/spring-cloud/spring-cloud-function/blob/master/spring-cloud-function-samples/function-sample-gcp-http/pom.xml[Spring Cloud Functions GCP sample].
-
-==== HTTP Functions
-
-Google Cloud Functions supports deploying https://cloud.google.com/functions/docs/writing/http[HTTP Functions], which are functions that are invoked by HTTP request. The sections below describe instructions for deploying a Spring Cloud Function as an HTTP Function.
-
-===== Getting Started
-
-Let’s start with a simple Spring Cloud Function example:
-
-[source, java]
-----
-@SpringBootApplication
-public class CloudFunctionMain {
-
- public static void main(String[] args) {
- SpringApplication.run(CloudFunctionMain.class, args);
- }
-
- @Bean
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-}
-----
-
-Specify your configuration main class in `resources/META-INF/MANIFEST.MF`.
-
-[source]
-----
-Main-Class: com.example.CloudFunctionMain
-----
-
-Then run the function locally.
-This is provided by the Google Cloud Functions `function-maven-plugin` described in the project dependencies section.
-
-----
-mvn function:run
-----
-
-Invoke the HTTP function:
-
-----
-curl http://localhost:8080/ -d "hello"
-----
-
-===== Deploy to GCP
-
-Start by packaging your application.
-
-----
-mvn package
-----
-
-If you added the custom `spring-boot-maven-plugin` plugin defined above, you should see the resulting JAR in `target/deploy` directory.
-This JAR is correctly formatted for deployment to Google Cloud Functions.
-
-Next, make sure that you have the https://cloud.google.com/sdk/install[Cloud SDK CLI] installed.
-
-From the project base directory run the following command to deploy.
-
-----
-gcloud functions deploy function-sample-gcp-http \
---entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher \
---runtime java11 \
---trigger-http \
---source target/deploy \
---memory 512MB
-----
-
-Invoke the HTTP function:
-
-----
-curl https://REGION-PROJECT_ID.cloudfunctions.net/function-sample-gcp-http -d "hello"
-----
-
-
-Setting custom HTTP statusCode:
-
-----
-Functions can specify a custom HTTP response code by setting the `FunctionInvoker.HTTP_STATUS_CODE` header.
-----
-
-[source, java]
-----
-@Bean
-public Function> function() {
-
- String payload = "hello";
-
- Message message = MessageBuilder.withPayload(payload).setHeader(FunctionInvoker.HTTP_STATUS_CODE, 404).build();
-
- return input -> message;
-};
-----
-
-
-
-==== Background Functions
-
-Google Cloud Functions also supports deploying https://cloud.google.com/functions/docs/writing/background[Background Functions] which are invoked indirectly in response to an event, such as a message on a https://cloud.google.com/pubsub[Cloud Pub/Sub] topic, a change in a https://cloud.google.com/storage[Cloud Storage] bucket, or a https://firebase.google.com/[Firebase] event.
-
-The `spring-cloud-function-adapter-gcp` allows for functions to be deployed as background functions as well.
-
-The sections below describe the process for writing a Cloud Pub/Sub topic background function.
-However, there are a number of different event types that can trigger a background function to execute which are not discussed here; these are described in the https://cloud.google.com/functions/docs/calling[Background Function triggers documentation].
-
-===== Getting Started
-
-Let’s start with a simple Spring Cloud Function which will run as a GCF background function:
-
-[source, java]
-----
-@SpringBootApplication
-public class BackgroundFunctionMain {
-
- public static void main(String[] args) {
- SpringApplication.run(BackgroundFunctionMain.class, args);
- }
-
- @Bean
- public Consumer pubSubFunction() {
- return message -> System.out.println("The Pub/Sub message data: " + message.getData());
- }
-}
-----
-
-In addition, create `PubSubMessage` class in the project with the below definition.
-This class represents the https://cloud.google.com/functions/docs/calling/pubsub#event_structure[Pub/Sub event structure] which gets passed to your function on a Pub/Sub topic event.
-
-[source, java]
-----
-public class PubSubMessage {
-
- private String data;
-
- private Map attributes;
-
- private String messageId;
-
- private String publishTime;
-
- public String getData() {
- return data;
- }
-
- public void setData(String data) {
- this.data = data;
- }
-
- public Map getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Map attributes) {
- this.attributes = attributes;
- }
-
- public String getMessageId() {
- return messageId;
- }
-
- public void setMessageId(String messageId) {
- this.messageId = messageId;
- }
-
- public String getPublishTime() {
- return publishTime;
- }
-
- public void setPublishTime(String publishTime) {
- this.publishTime = publishTime;
- }
-
-}
-----
-
-Specify your configuration main class in `resources/META-INF/MANIFEST.MF`.
-
-[source]
-----
-Main-Class: com.example.BackgroundFunctionMain
-----
-
-Then run the function locally.
-This is provided by the Google Cloud Functions `function-maven-plugin` described in the project dependencies section.
-
-----
-mvn function:run
-----
-
-Invoke the HTTP function:
-
-----
-curl localhost:8080 -H "Content-Type: application/json" -d '{"data":"hello"}'
-----
-
-Verify that the function was invoked by viewing the logs.
-
-===== Deploy to GCP
-
-In order to deploy your background function to GCP, first package your application.
-
-----
-mvn package
-----
-
-If you added the custom `spring-boot-maven-plugin` plugin defined above, you should see the resulting JAR in `target/deploy` directory.
-This JAR is correctly formatted for deployment to Google Cloud Functions.
-
-Next, make sure that you have the https://cloud.google.com/sdk/install[Cloud SDK CLI] installed.
-
-From the project base directory run the following command to deploy.
-
-----
-gcloud functions deploy function-sample-gcp-background \
---entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher \
---runtime java11 \
---trigger-topic my-functions-topic \
---source target/deploy \
---memory 512MB
-----
-
-Google Cloud Function will now invoke the function every time a message is published to the topic specified by `--trigger-topic`.
-
-For a walkthrough on testing and verifying your background function, see the instructions for running the https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-gcp-background/[GCF Background Function sample].
-
-==== Sample Functions
-
-The project provides the following sample functions as reference:
-
-* The https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-gcp-http/[function-sample-gcp-http] is an HTTP Function which you can test locally and try deploying.
-* The https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-gcp-background/[function-sample-gcp-background] shows an example of a background function that is triggered by a message being published to a specified Pub/Sub topic.
diff --git a/docs/src/main/asciidoc/adapters/gcp.adoc b/docs/src/main/asciidoc/adapters/gcp.adoc
deleted file mode 100644
index 3b72f8bfe..000000000
--- a/docs/src/main/asciidoc/adapters/gcp.adoc
+++ /dev/null
@@ -1,3 +0,0 @@
-*{project-version}*
-
-include::adapters/gcp-intro.adoc[]
diff --git a/docs/src/main/asciidoc/functional.adoc b/docs/src/main/asciidoc/functional.adoc
deleted file mode 100644
index a12f520ac..000000000
--- a/docs/src/main/asciidoc/functional.adoc
+++ /dev/null
@@ -1,316 +0,0 @@
-Spring Cloud Function supports a "functional" style of bean declarations for small apps where you need fast startup. The functional style of bean declaration was a feature of Spring Framework 5.0 with significant enhancements in 5.1.
-
-== Comparing Functional with Traditional Bean Definitions
-
-Here's a vanilla Spring Cloud Function application from with the
-familiar `@Configuration` and `@Bean` declaration style:
-
-```java
-@SpringBootApplication
-public class DemoApplication {
-
- @Bean
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-
- public static void main(String[] args) {
- SpringApplication.run(DemoApplication.class, args);
- }
-
-}
-```
-
-Now for the functional beans: the user application code can be recast into "functional"
-form, like this:
-
-```java
-@SpringBootConfiguration
-public class DemoApplication implements ApplicationContextInitializer {
-
- public static void main(String[] args) {
- FunctionalSpringApplication.run(DemoApplication.class, args);
- }
-
- public Function uppercase() {
- return value -> value.toUpperCase();
- }
-
- @Override
- public void initialize(GenericApplicationContext context) {
- context.registerBean("demo", FunctionRegistration.class,
- () -> new FunctionRegistration<>(uppercase())
- .type(FunctionTypeUtils.functionType(String.class, String.class)));
- }
-
-}
-```
-
-The main differences are:
-
-* The main class is an `ApplicationContextInitializer`.
-
-* The `@Bean` methods have been converted to calls to `context.registerBean()`
-
-* The `@SpringBootApplication` has been replaced with
-`@SpringBootConfiguration` to signify that we are not enabling Spring
-Boot autoconfiguration, and yet still marking the class as an "entry
-point".
-
-* The `SpringApplication` from Spring Boot has been replaced with a
-`FunctionalSpringApplication` from Spring Cloud Function (it's a
-subclass).
-
-The business logic beans that you register in a Spring Cloud Function app are of type `FunctionRegistration`.
-This is a wrapper that contains both the function and information about the input and output types. In the `@Bean`
-form of the application that information can be derived reflectively, but in a functional bean registration some of
-it is lost unless we use a `FunctionRegistration`.
-
-An alternative to using an `ApplicationContextInitializer` and `FunctionRegistration` is to make the application
-itself implement `Function` (or `Consumer` or `Supplier`). Example (equivalent to the above):
-
-```java
-@SpringBootConfiguration
-public class DemoApplication implements Function {
-
- public static void main(String[] args) {
- FunctionalSpringApplication.run(DemoApplication.class, args);
- }
-
- @Override
- public String apply(String value) {
- return value.toUpperCase();
- }
-
-}
-```
-
-It would also work if you add a separate, standalone class of type `Function` and register it with
-the `SpringApplication` using an alternative form of the `run()` method. The main thing is that the generic
-type information is available at runtime through the class declaration.
-
-Suppose you have
-[source, java]
-----
-@Component
-public class CustomFunction implements Function, Flux> {
- @Override
- public Flux apply(Flux flux) {
- return flux.map(foo -> new Bar("This is a Bar object from Foo value: " + foo.getValue()));
- }
-
-}
-----
-
-You register it as such:
-
-[source, java]
-----
-@Override
-public void initialize(GenericApplicationContext context) {
- context.registerBean("function", FunctionRegistration.class,
- () -> new FunctionRegistration<>(new CustomFunction()).type(CustomFunction.class));
-}
-----
-
-== Limitations of Functional Bean Declaration
-
-Most Spring Cloud Function apps have a relatively small scope compared to the whole of Spring Boot,
-so we are able to adapt it to these functional bean definitions easily. If you step outside that limited scope,
-you can extend your Spring Cloud Function app by switching back to `@Bean` style configuration, or by using a hybrid
-approach. If you want to take advantage of Spring Boot autoconfiguration for integrations with external datastores,
-for example, you will need to use `@EnableAutoConfiguration`. Your functions can still be defined using the functional
-declarations if you want (i.e. the "hybrid" style), but in that case you will need to explicitly switch off the "full
-functional mode" using `spring.functional.enabled=false` so that Spring Boot can take back control.
-
-[[function_visualization]]
-= Function visualization and control
-
-Spring Cloud Function supports visualization of functions available in `FunctionCatalog` through Actuator endpoints as well as programmatic way.
-
-==== Programmatic way
-
-To see function available within your application context programmatically all you need is access to `FunctionCatalog`. There you can
-finds methods to get the size of the catalog, lookup functions as well as list the names of all the available functions.
-
-For example,
-
-[source,java]
-----
-FunctionCatalog functionCatalog = context.getBean(FunctionCatalog.class);
-int size = functionCatalog.size(); // will tell you how many functions available in catalog
-Set names = functionCatalog.getNames(null); will list the names of all the Function, Suppliers and Consumers available in catalog
-. . .
-----
-
-==== Actuator
-Since actuator and web are optional, you must first add one of the web dependencies as well as add the actuator dependency manually.
-The following example shows how to add the dependency for the Web framework:
-
-[source,xml]
-----
-
- org.springframework.boot
- spring-boot-starter-web
-
-----
-
-The following example shows how to add the dependency for the WebFlux framework:
-
-[source,xml]
-----
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-----
-
-You can add the Actuator dependency as follows:
-[source,xml]
-----
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-----
-
-You must also enable the `functions` actuator endpoints by setting the following property: `--management.endpoints.web.exposure.include=functions`.
-
-Access the following URL to see the functions in FunctionCatalog:
-`http://:/actuator/functions`
-
-For example,
-[source,text]
-----
-curl http://localhost:8080/actuator/functions
-----
-
-Your output should look something like this:
-[source,text]
-----
-{"charCounter":
- {"type":"FUNCTION","input-type":"string","output-type":"integer"},
- "logger":
- {"type":"CONSUMER","input-type":"string"},
- "functionRouter":
- {"type":"FUNCTION","input-type":"object","output-type":"object"},
- "words":
- {"type":"SUPPLIER","output-type":"string"}. . .
-----
-
-= Testing Functional Applications
-
-Spring Cloud Function also has some utilities for integration testing that will be very familiar to Spring Boot users.
-
-Suppose this is your application:
-
-[source, java]
-----
-@SpringBootApplication
-public class SampleFunctionApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SampleFunctionApplication.class, args);
- }
-
- @Bean
- public Function uppercase() {
- return v -> v.toUpperCase();
- }
-}
-----
-
-Here is an integration test for the HTTP server wrapping this application:
-
-[source, java]
-----
-@SpringBootTest(classes = SampleFunctionApplication.class,
- webEnvironment = WebEnvironment.RANDOM_PORT)
-public class WebFunctionTests {
-
- @Autowired
- private TestRestTemplate rest;
-
- @Test
- public void test() throws Exception {
- ResponseEntity result = this.rest.exchange(
- RequestEntity.post(new URI("/uppercase")).body("hello"), String.class);
- System.out.println(result.getBody());
- }
-}
-----
-
-or when function bean definition style is used:
-
-[source, java]
-----
-@FunctionalSpringBootTest
-public class WebFunctionTests {
-
- @Autowired
- private TestRestTemplate rest;
-
- @Test
- public void test() throws Exception {
- ResponseEntity result = this.rest.exchange(
- RequestEntity.post(new URI("/uppercase")).body("hello"), String.class);
- System.out.println(result.getBody());
- }
-}
-----
-
-This test is almost identical to the one you would write for the `@Bean` version of the same app - the only difference
-is the `@FunctionalSpringBootTest` annotation, instead of the regular `@SpringBootTest`. All the other pieces,
-like the `@Autowired` `TestRestTemplate`, are standard Spring Boot features.
-
-And to help with correct dependencies here is the excerpt from POM
-
-[source, xml, subs=attributes+]
-----
-
- org.springframework.boot
- spring-boot-starter-parent
- {spring-boot-version}
-
-
- . . . .
-
- org.springframework.cloud
- spring-cloud-function-web
- {project-version}
-
-
- org.springframework.boot
- spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-web
- test
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-----
-
-Or you could write a test for a non-HTTP app using just the `FunctionCatalog`. For example:
-
-[source, java]
-----
-@FunctionalSpringBootTest
-public class FunctionalTests {
-
- @Autowired
- private FunctionCatalog catalog;
-
- @Test
- public void words() {
- Function function = catalog.lookup(Function.class,
- "uppercase");
- assertThat(function.apply("hello")).isEqualTo("HELLO");
- }
-
-}
-----
diff --git a/docs/src/main/asciidoc/getting-started.adoc b/docs/src/main/asciidoc/getting-started.adoc
deleted file mode 100644
index f46cbe0c7..000000000
--- a/docs/src/main/asciidoc/getting-started.adoc
+++ /dev/null
@@ -1,33 +0,0 @@
-Build from the command line (and "install" the samples):
-
-----
-$ ./mvnw clean install
-----
-
-(If you like to YOLO add `-DskipTests`.)
-
-Run one of the samples, e.g.
-
-----
-$ java -jar spring-cloud-function-samples/function-sample/target/*.jar
-----
-
-This runs the app and exposes its functions over HTTP, so you can
-convert a string to uppercase, like this:
-
-----
-$ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d Hello
-HELLO
-----
-
-You can convert multiple strings (a `Flux`) by separating them
-with new lines
-
-----
-$ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d 'Hello
-> World'
-HELLOWORLD
-----
-
-(You can use `^Q^J` in a terminal to insert a new line in a literal
-string like that.)
diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh
deleted file mode 100755
index 2562c7171..000000000
--- a/docs/src/main/asciidoc/ghpages.sh
+++ /dev/null
@@ -1,330 +0,0 @@
-#!/bin/bash -x
-
-set -e
-
-# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
-function set_default_props() {
- # The script should be executed from the root folder
- ROOT_FOLDER=`pwd`
- echo "Current folder is ${ROOT_FOLDER}"
-
- if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
- echo "You're not in the root folder of the project!"
- exit 1
- fi
-
- # Prop that will let commit the changes
- COMMIT_CHANGES="no"
- MAVEN_PATH=${MAVEN_PATH:-}
- echo "Path to Maven is [${MAVEN_PATH}]"
- REPO_NAME=${PWD##*/}
- echo "Repo name is [${REPO_NAME}]"
- SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
- echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
-}
-
-# Check if gh-pages exists and docs have been built
-function check_if_anything_to_sync() {
- git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
-
- if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
- echo "No gh-pages, so not syncing"
- exit 0
- fi
-
- if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
- echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
- exit 0
- fi
-}
-
-function retrieve_current_branch() {
- # Code getting the name of the current branch. For master we want to publish as we did until now
- # https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
- # If there is a branch already passed will reuse it - otherwise will try to find it
- CURRENT_BRANCH=${BRANCH}
- if [[ -z "${CURRENT_BRANCH}" ]] ; then
- CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
- CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
- CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
- fi
- echo "Current branch is [${CURRENT_BRANCH}]"
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
-}
-
-# Switches to the provided value of the release version. We always prefix it with `v`
-function switch_to_tag() {
- git checkout v${VERSION}
-}
-
-# Build the docs if switch is on
-function build_docs_if_applicable() {
- if [[ "${BUILD}" == "yes" ]] ; then
- ./mvnw clean install -P docs -pl docs -DskipTests
- fi
-}
-
-# Get the name of the `docs.main` property
-# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
-function retrieve_doc_properties() {
- MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args='${docs.main}' \
- --non-recursive \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
-
-
- WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
- WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args="\${${WHITELIST_PROPERTY}}" \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
- -P docs \
- -pl docs)
- echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
-}
-
-# Stash any outstanding changes
-function stash_changes() {
- git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
- if [ "$dirty" != "0" ]; then git stash; fi
-}
-
-# Switch to gh-pages branch to sync it with current branch
-function add_docs_from_target() {
- local DESTINATION_REPO_FOLDER
- if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
- DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
- elif [[ "${CLONE}" == "yes" ]]; then
- mkdir -p ${ROOT_FOLDER}/target
- local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
- if [[ ! -e "${clonedStatic}/.git" ]]; then
- echo "Cloning Spring Cloud Static to target"
- git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages
- else
- echo "Spring Cloud Static already cloned - will pull changes"
- cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
- fi
- DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- else
- if [[ ! -e "${DESTINATION}/.git" ]]; then
- echo "[${DESTINATION}] is not a git repository"
- exit 1
- fi
- DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- echo "Destination was provided [${DESTINATION}]"
- fi
- cd ${DESTINATION_REPO_FOLDER}
- git checkout gh-pages
- git pull origin gh-pages
-
- # Add git branches
- ###################################################################
- if [[ -z "${VERSION}" ]] ; then
- copy_docs_for_current_version
- else
- copy_docs_for_provided_version
- fi
- commit_changes_if_applicable
-}
-
-
-# Copies the docs by using the retrieved properties from Maven build
-function copy_docs_for_current_version() {
- if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
- echo -e "Current branch is master - will copy the current docs only to the root folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- cp -rf $f ${ROOT_FOLDER}/
- git add -A ${ROOT_FOLDER}/$file
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Current branch is [${CURRENT_BRANCH}]"
- # https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
- if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
- mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
- echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- # We want users to access 2.0.0.BUILD-SNAPSHOT/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- else
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
- fi
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
- [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
- fi
- fi
-}
-
-# Copies the docs by using the explicitly provided version
-function copy_docs_for_provided_version() {
- local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
- mkdir -p ${FOLDER}
- echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
- for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
- file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
- copy_docs_for_branch ${file} ${FOLDER}
- done
- COMMIT_CHANGES="yes"
- CURRENT_BRANCH="v${VERSION}"
-}
-
-# Copies the docs from target to the provided destination
-# Params:
-# $1 - file from target
-# $2 - destination to which copy the files
-function copy_docs_for_branch() {
- local file=$1
- local destination=$2
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
- # Not ignored...
- # We want users to access 2.0.0.BUILD-SNAPSHOT/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${destination}/index.html
- git add -A ${destination}/index.html
- else
- cp -rf $f ${destination}
- git add -A ${destination}/$file
- fi
- fi
-}
-
-function commit_changes_if_applicable() {
- if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
- COMMIT_SUCCESSFUL="no"
- git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
-
- # Uncomment the following push if you want to auto push to
- # the gh-pages branch whenever you commit to master locally.
- # This is a little extreme. Use with care!
- ###################################################################
- if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
- git push origin gh-pages
- fi
- fi
-}
-
-# Switch back to the previous branch and exit block
-function checkout_previous_branch() {
- # If -version was provided we need to come back to root project
- cd ${ROOT_FOLDER}
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
- if [ "$dirty" != "0" ]; then git stash pop; fi
- exit 0
-}
-
-# Assert if properties have been properly passed
-function assert_properties() {
-echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
-if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
-if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
-if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
-}
-
-# Prints the usage
-function print_usage() {
-cat </`
-- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
- switch to gh-pages of that repo and copy the generated docs to `docs//`
-
-USAGE:
-
-You can use the following options:
-
--v|--version - the script will apply the whole procedure for a particular library version
--d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
- E.g. point to spring-cloud-static folder. Can't be used with (-c)
--b|--build - will run the standard build process after checking out the branch
--c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
- Obviously can't be used with (-d)
-
-EOF
-}
-
-
-# ==========================================
-# ____ ____ _____ _____ _____ _______
-# / ____|/ ____| __ \|_ _| __ \__ __|
-# | (___ | | | |__) | | | | |__) | | |
-# \___ \| | | _ / | | | ___/ | |
-# ____) | |____| | \ \ _| |_| | | |
-# |_____/ \_____|_| \_\_____|_| |_|
-#
-# ==========================================
-
-while [[ $# > 0 ]]
-do
-key="$1"
-case ${key} in
- -v|--version)
- VERSION="$2"
- shift # past argument
- ;;
- -d|--destination)
- DESTINATION="$2"
- shift # past argument
- ;;
- -b|--build)
- BUILD="yes"
- ;;
- -c|--clone)
- CLONE="yes"
- ;;
- -h|--help)
- print_usage
- exit 0
- ;;
- *)
- echo "Invalid option: [$1]"
- print_usage
- exit 1
- ;;
-esac
-shift # past argument or value
-done
-
-assert_properties
-set_default_props
-check_if_anything_to_sync
-if [[ -z "${VERSION}" ]] ; then
- retrieve_current_branch
-else
- switch_to_tag
-fi
-build_docs_if_applicable
-retrieve_doc_properties
-stash_changes
-add_docs_from_target
-checkout_previous_branch
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/images/AWS-deploy.png b/docs/src/main/asciidoc/images/AWS-deploy.png
deleted file mode 100644
index c840e1396..000000000
Binary files a/docs/src/main/asciidoc/images/AWS-deploy.png and /dev/null differ
diff --git a/docs/src/main/asciidoc/images/remove.txt b/docs/src/main/asciidoc/images/remove.txt
deleted file mode 100644
index bbd40769d..000000000
--- a/docs/src/main/asciidoc/images/remove.txt
+++ /dev/null
@@ -1 +0,0 @@
-please remove once this directory is not empty
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/images/scf-azure-adapter.svg b/docs/src/main/asciidoc/images/scf-azure-adapter.svg
deleted file mode 100644
index 8a064d8f4..000000000
--- a/docs/src/main/asciidoc/images/scf-azure-adapter.svg
+++ /dev/null
@@ -1,272 +0,0 @@
-
-
-
-
diff --git a/docs/src/main/asciidoc/index.adoc b/docs/src/main/asciidoc/index.adoc
deleted file mode 100644
index ebc517b8a..000000000
--- a/docs/src/main/asciidoc/index.adoc
+++ /dev/null
@@ -1,23 +0,0 @@
-= Spring Cloud Function Reference Documentation
-Mark Fisher, Dave Syer, Oleg Zhurakousky, Anshul Mehra, Dan Dobrin, Chris Bono, Artem Bilan
-
-*{project-version}*
-
-:docinfo: shared
-
-The reference documentation consists of the following sections:
-
-[horizontal]
-<> :: Spring Cloud Function Reference
-https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-cloudevent[Cloud Events] :: Cloud Events
-https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-rsocket[RSocket] :: RSocket
-<<./spring-integration.adoc#spring-integration,Spring Integration>> :: Spring Integration Framework Interaction
-<> :: AWS Adapter Reference
-<> :: Azure Adapter Reference
-<> :: GCP Adapter Reference
-
-
-Relevant Links:
-
-[horizontal]
-https://projectreactor.io/[Reactor] :: Project Reactor
diff --git a/docs/src/main/asciidoc/sagan-index.adoc b/docs/src/main/asciidoc/sagan-index.adoc
deleted file mode 100644
index fac997ff1..000000000
--- a/docs/src/main/asciidoc/sagan-index.adoc
+++ /dev/null
@@ -1,46 +0,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._
-* _Function composition and adaptation (e.g., composing imperative functions with reactive)._
-* _Support for reactive function with multiple inputs and outputs allowing merging, joining and other complex streaming operation to be handled by functions._
-* _Transparent type conversion of inputs and outputs._
-* _Packaging functions for deployments, specific to the target platform (e.g., Project Riff, AWS Lambda and more)_
-* _Adapters to expose function to the outside world as HTTP endpoints etc._
-* _Deploying a JAR file containing such an application context with an isolated classloader, so that you can pack them together in a single JVM._
-* _Adapters for https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS Lambda], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Microsoft Azure], https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp[Google Cloud Functions], and possibly other "serverless" service providers._
-
-Here's a complete, executable, testable Spring Boot application (implementing a simple string manipulation):
-
-```java
-@SpringBootApplication
-public class Application {
- public static void main(String[] args) {
- SpringApplication.run(Application.class, args);
- }
-
- @Bean
- public Function, Flux> uppercase() {
- return flux -> flux.map(value -> value.toUpperCase());
- }
-}
-```
-### Sample Projects
-
-* https://github.com/spring-cloud/spring-cloud-function/blob/master/spring-cloud-function-samples/function-sample[Vanilla]
-* https://github.com/spring-cloud/spring-cloud-function/blob/master/spring-cloud-function-samples/function-sample-pof[Plain Old Function]
-* https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws[AWS Lambda]
-* https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-azure[Microsoft Azure]
-* https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-gcp-http[Google Cloud Functions]
-
-
diff --git a/docs/src/main/asciidoc/spring-cloud-function.adoc b/docs/src/main/asciidoc/spring-cloud-function.adoc
deleted file mode 100644
index 7eea6e5fc..000000000
--- a/docs/src/main/asciidoc/spring-cloud-function.adoc
+++ /dev/null
@@ -1,1031 +0,0 @@
-= Spring Cloud Function
-
-Mark Fisher, Dave Syer, Oleg Zhurakousky, Anshul Mehra, Dan Dobrin
-
-*{project-version}*
-
----
-
-:github: https://github.com/spring-cloud/spring-cloud-function
-:githubmaster: {github}/tree/master
-:docslink: {githubmaster}/docs/src/main/asciidoc
-:nofooter:
-:branch: master
-
-== Introduction
-
-include::_intro.adoc[]
-
-include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]
-
-== Getting Started
-
-include::getting-started.adoc[]
-
-== Programming model
-
-[[function.catalog]]
-
-=== Function Catalog and Flexible Function Signatures
-
-One of the main features of Spring Cloud Function is to adapt and support a range of type signatures for user-defined functions,
-while providing a consistent execution model.
-That's why all user defined functions are transformed into a canonical representation by `FunctionCatalog`.
-
-While users don't normally have to care about the `FunctionCatalog` at all, it is useful to know what
-kind of functions are supported in user code.
-
-It is also important to understand that Spring Cloud Function provides first class support for reactive API
-provided by https://projectreactor.io/[Project Reactor] allowing reactive primitives such as `Mono` and `Flux`
-to be used as types in user defined functions providing greater flexibility when choosing programming model for
-your function implementation.
-Reactive programming model also enables functional support for features that would be otherwise difficult to impossible to implement
-using imperative programming style. For more on this please read <> section.
-
-=== Java 8 function support
-
-Spring Cloud Function embraces and builds on top of the 3 core functional interfaces defined by Java
-and available to us since Java 8.
-
-- Supplier
-- Function
-- Consumer
-
-To avoid constantly mentioning `Supplier`, `Function` and `Consumer` we’ll refer to them a Functional beans for the rest of this manual where appropriate.
-
-In a nutshell, any bean in your Application Context that is Functional bean will lazily be registered with `FunctionCatalog`.
-This means that it could benefit from all of the additional features described in this reference manual.
-
-In a simplest of application all you need to do is to declare `@Bean` of type `Supplier`, `Function` or `Consumer` in your application configuration.
-Then you can access `FunctionCatalog` and lookup a particular function based on its name.
-
-For example:
-
-
-[source, test]
-----
-@Bean
-public Function uppercase() {
- return value -> value.toUpperCase();
-}
-
-. . .
-
-FunctionCatalog catalog = applicationContext.getBean(FunctionCatalog.class);
-Function uppercase = catalog.lookup(“uppercase”);
-----
-
-Important to understand that given that `uppercase` is a bean, you can certainly get it form the `ApplicationContext` directly, but all you will get is just your bean as you declared it without any extra features provided by SCF. When you do lookup of a function via `FunctionCatalog`, the instance you will receive is wrapped (instrumented) with additional features (i.e., type conversion, composition etc.) described in this manual. Also, it is important to understand that a typical user does not use Spring Cloud Function directly. Instead a typical user implements Java `Function/Supplier/Consumer` with the idea of using it in different execution contexts without additional work. For example the same java function could be represented as _REST endpoint_ or _Streaming message handler_ or _AWS Lambda_ and more via Spring Cloud Function provided
-adapters as well as other frameworks using Spring Cloud Function as the core programming model (e.g., https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream])
-So in summary Spring Cloud Function instruments java functions with additional features to be utilised in variety of execution contexts.
-
-
-==== Function definition
-While the previous example shows you how to lookup function in FunctionCatalog programmatically, in a typical integration case where Spring Cloud Function used as programming model by another framework (e.fg. Spring Cloud Stream), you declare which functions to use via `spring.cloud.function.definition` property. Knowing that it is important to understand some default behaviour when it comes to discovering functions in `FunctionCatalog`. For example, if you only have one Functional bean in your `ApplicationContext`, the `spring.cloud.function.definition` property typically will not be required, since a single function in `FunctionCatalog` can be looked up by an empty name or any name. For example, assuming that `uppercase` is the only function in your catalog, it can be looked up as `catalog.lookup(null)`, `catalog.lookup(“”)`, `catalog.lookup(“foo”)`
-That said, for cases where you are using framework such as Spring Cloud Stream which uses `spring.cloud.function.definition` it is best practice and recommended to always use `spring.cloud.function.definition` property.
-
-For example,
-
-[source, test]
-----
-spring.cloud.function.definition=uppercase
-----
-
-==== Filtering ineligible functions
-A typical Application Context may include beans that are valid java functions, but not intended to be candidates to be registered with `FunctionCatalog`.
-Such beans could be auto-configurations from other projects or any other beans that qualify to be Java functions.
-The framework provides default filtering of known beans that should not be candidates for registration with function catalog.
-You can also add to this list additional beans by providing coma delimited list of bean definition names using
-`spring.cloud.function.ineligible-definitions` property.
-
-For example,
-
-[source, test]
-----
-spring.cloud.function.ineligible-definitions=foo,bar
-----
-
-==== Supplier
-Supplier can be _reactive_ - `Supplier>`
-or _imperative_ - `Supplier`. From the invocation standpoint this should make no difference
-to the implementor of such Supplier. However, when used within frameworks
-(e.g., https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream]), Suppliers, especially reactive,
-often used to represent the source of the stream, therefore they are invoked once to get the stream (e.g., Flux)
-to which consumers can subscribe to. In other words such suppliers represent an equivalent of an _infinite stream_.
-However, the same reactive suppliers can also represent _finite_ stream(s) (e.g., result set on the polled JDBC data).
-In those cases such reactive suppliers must be hooked up to some polling mechanism of the underlying framework.
-
-To assist with that Spring Cloud Function provides a marker annotation
-`org.springframework.cloud.function.context.PollableBean` to signal that such supplier produces a
-finite stream and may need to be polled again. That said, it is important to understand that Spring Cloud Function itself
-provides no behavior for this annotation.
-
-In addition `PollableBean` annotation exposes a _splittable_ attribute to signal that produced stream
-needs to be split (see https://www.enterpriseintegrationpatterns.com/patterns/messaging/Sequencer.html[Splitter EIP])
-
-Here is the example:
-
-[source, java]
-----
-@PollableBean(splittable = true)
-public Supplier> someSupplier() {
- return () -> {
- String v1 = String.valueOf(System.nanoTime());
- String v2 = String.valueOf(System.nanoTime());
- String v3 = String.valueOf(System.nanoTime());
- return Flux.just(v1, v2, v3);
- };
-}
-----
-
-==== Function
-Function can also be written in imperative or reactive way, yet unlike Supplier and Consumer there are
-no special considerations for the implementor other then understanding that when used within frameworks
-such as https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream] and others, reactive function is
-invoked only once to pass a reference to the stream (Flux or Mono) and imperative is invoked once per event.
-
-==== Consumer
-Consumer is a little bit special because it has a `void` return type,
-which implies blocking, at least potentially. Most likely you will not
-need to write `Consumer>`, but if you do need to do that,
-remember to subscribe to the input flux.
-
-=== Function Composition
-Function Composition is a feature that allows one to compose several functions into one.
-The core support is based on function composition feature available with https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html#andThen-java.util.function.Function-[Function.andThen(..)]
-support available since Java 8. However on top of it, we provide few additional features.
-
-==== Declarative Function Composition
-
-This feature allows you to provide composition instruction in a declarative way using `|` (pipe) or `,` (comma) delimiter
-when providing `spring.cloud.function.definition` property.
-
-For example
-----
---spring.cloud.function.definition=uppercase|reverse
-----
-Here we effectively provided a definition of a single function which itself is a composition of
-function `uppercase` and function `reverse`. In fact that is one of the reasons why the property name is _definition_ and not _name_,
-since the definition of a function can be a composition of several named functions.
-And as mentioned you can use `,` instead of pipe (such as `...definition=uppercase,reverse`).
-
-==== Composing non-Functions
-Spring Cloud Function also supports composing Supplier with `Consumer` or `Function` as well as `Function` with `Consumer`.
-What's important here is to understand the end product of such definitions.
-Composing Supplier with Function still results in Supplier while composing Supplier with Consumer will effectively render Runnable.
-Following the same logic composing Function with Consumer will result in Consumer.
-
-And of course you can't compose uncomposable such as Consumer and Function, Consumer and Supplier etc.
-
-
-=== Function Routing and Filtering
-
-Since version 2.2 Spring Cloud Function provides routing feature allowing
-you to invoke a single function which acts as a router to an actual function you wish to invoke
-This feature is very useful in certain FAAS environments where maintaining configurations
-for several functions could be cumbersome or exposing more than one function is not possible.
-
-The `RoutingFunction` is registered in _FunctionCatalog_ under the name `functionRouter`. For simplicity
-and consistency you can also refer to `RoutingFunction.FUNCTION_NAME` constant.
-
-This function has the following signature:
-
-[source, java]
-----
-public class RoutingFunction implements Function