├── .springformat
├── spring-cloud-function-core
├── .jdk8
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── function
│ └── core
│ └── FunctionInvocationHelper.java
├── spring-cloud-function-web
├── .jdk8
├── src
│ ├── test
│ │ └── resources
│ │ │ └── static
│ │ │ └── test.html
│ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ ├── spring
│ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ │ ├── additional-spring-configuration-metadata.json
│ │ │ └── spring.factories
│ │ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── function
│ │ └── web
│ │ ├── StringConverter.java
│ │ ├── source
│ │ ├── DestinationResolver.java
│ │ ├── RequestBuilder.java
│ │ └── SimpleDestinationResolver.java
│ │ └── RestApplication.java
└── refactoring_notes
├── spring-cloud-function-kotlin
├── .jdk8
├── src
│ ├── main
│ │ └── resources
│ │ │ └── META-INF
│ │ │ └── spring.factories
│ └── test
│ │ └── kotlin
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── function
│ │ └── kotlin
│ │ ├── ComponentUppercase.kt
│ │ ├── KotlinComponentFunction.kt
│ │ ├── ComponentWithUnitReturn.kt
│ │ ├── KotlinComponentMessageFunction.kt
│ │ ├── KotlinPostProcessingFunction.kt
│ │ └── Person.kt
└── README.adoc
├── spring-cloud-function-rsocket
├── .jdk8
├── src
│ ├── main
│ │ └── resources
│ │ │ └── META-INF
│ │ │ ├── spring.factories
│ │ │ └── spring
│ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ └── test
│ │ └── resources
│ │ └── application.properties
└── NOTES.txt
├── .github
├── dco.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── stale.yml
│ └── deploy-docs.yml
├── spring-cloud-function-samples
├── function-sample
│ ├── .jdk8
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── application.properties
│ │ │ └── META-INF
│ │ │ │ └── thin-rabbit.properties
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── functions
│ │ │ ├── Greeter.java
│ │ │ ├── CharCounter.java
│ │ │ └── Exclaimer.java
│ └── gradle
│ │ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── function-sample-aws
│ ├── .jdk8
│ ├── input.json
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── META-INF
│ │ │ │ │ └── mask.keys
│ │ │ │ ├── application.properties
│ │ │ │ └── log4j.properties
│ │ │ └── java
│ │ │ │ └── example
│ │ │ │ └── FunctionConfiguration.java
│ │ └── test
│ │ │ └── java
│ │ │ └── example
│ │ │ └── MapTests.java
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── template.yml
├── function-sample-pojo
│ ├── .jdk8
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ └── src
│ │ └── main
│ │ ├── resources
│ │ └── application.properties
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── LowercaseConfiguration.java
├── scf-aws-sam
│ ├── README.md
│ └── .gitignore
├── function-sample-aws-routing
│ ├── .jdk8
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── log4j.properties
│ │ │ └── java
│ │ │ │ └── example
│ │ │ │ └── FunctionConfiguration.java
│ │ └── test
│ │ │ └── java
│ │ │ └── example
│ │ │ └── MapTests.java
│ └── gradle
│ │ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── function-functional-sample-aws
│ ├── .jdk8
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── log4j.properties
│ │ │ └── java
│ │ │ │ └── example
│ │ │ │ └── TestFunction.java
│ │ └── test
│ │ │ └── java
│ │ │ └── example
│ │ │ └── MapTests.java
│ └── gradle
│ │ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── function-sample-functional-aws-routing
│ ├── .jdk8
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── log4j.properties
│ │ └── test
│ │ │ └── java
│ │ │ └── example
│ │ │ └── MapTests.java
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ └── README.adoc
├── scf-aws-day1
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── java
│ │ │ │ └── oz
│ │ │ │ └── spring
│ │ │ │ └── aws
│ │ │ │ ├── FunctionAwsApplication.java
│ │ │ │ └── functions
│ │ │ │ └── FunctionConfiguration.java
│ │ └── test
│ │ │ └── java
│ │ │ └── oz
│ │ │ └── spring
│ │ │ └── aws
│ │ │ └── FunctionAwsApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── .gitignore
│ └── README.md
├── scf-aws-routing
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.properties
│ │ │ └── java
│ │ │ └── oz
│ │ │ └── spring
│ │ │ └── aws
│ │ │ ├── FunctionAwsApplication.java
│ │ │ └── functions
│ │ │ └── FunctionRoutingConfiguration.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── .gitignore
│ └── README.md
├── function-sample-kotlin-web
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.properties
│ │ │ └── kotlin
│ │ │ └── com
│ │ │ └── example
│ │ │ └── kotlin
│ │ │ ├── DemoKotlinConfiguration.kt
│ │ │ └── DemoKotlinApplication.kt
│ ├── images
│ │ ├── rabbit-send-binary.png
│ │ └── rabbit-send-structured.png
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── .gitignore
│ └── README.adoc
├── function-sample-aws-native
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ └── application.properties
│ │ ├── shell
│ │ │ ├── native
│ │ │ │ └── bootstrap
│ │ │ └── java
│ │ │ │ └── bootstrap
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ └── NativeUppercaseApplicationTests.java
│ │ └── assembly
│ │ │ ├── native.xml
│ │ │ └── java.xml
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-cloudevent-sdk
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.properties
│ │ │ └── java
│ │ │ └── io
│ │ │ └── spring
│ │ │ └── cloudevent
│ │ │ └── DemoApplication.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-azure
│ ├── .gitignore
│ ├── src
│ │ └── main
│ │ │ └── azure
│ │ │ ├── host.json
│ │ │ └── local.settings.json
│ └── Dockerfile
├── function-sample-cloudevent-rsocket
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.properties
│ │ │ └── java
│ │ │ └── io
│ │ │ └── spring
│ │ │ └── cloudevent
│ │ │ ├── Person.java
│ │ │ ├── Employee.java
│ │ │ └── DemoApplication.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-grpc-cloudevent
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── proto
│ │ │ │ ├── CloudEventService.proto
│ │ │ │ └── CloudEvent.proto
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── grpc
│ │ │ └── demo
│ │ │ └── DemoGrpcApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-azure-blob-trigger
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ ├── host.json
│ │ │ │ └── local.settings.json
│ │ └── test
│ │ │ ├── resource
│ │ │ └── sample.txt
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── azure
│ │ │ └── di
│ │ │ └── azureblobtriggerdemo
│ │ │ └── AzureBlobTriggerDemoApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-azure-http-trigger
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── host.json
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── azure
│ │ │ └── di
│ │ │ └── httptriggerdemo
│ │ │ └── HttptriggerDemoApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-azure-time-trigger
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ ├── host.json
│ │ │ │ └── local.settings.json
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── azure
│ │ │ └── di
│ │ │ └── timetriggerdemo
│ │ │ └── TimetriggerDemoApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-spring-integration
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── application.properties
│ ├── settings.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ └── build.gradle
├── function-sample-aws-serverless-web-native
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── META-INF
│ │ │ │ │ └── .gitignore
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ ├── DemoApplication.java
│ │ │ │ ├── HelloController.java
│ │ │ │ └── model
│ │ │ │ └── model
│ │ │ │ └── Error.java
│ │ ├── shell
│ │ │ ├── native
│ │ │ │ └── bootstrap
│ │ │ └── java
│ │ │ │ └── bootstrap
│ │ └── assembly
│ │ │ ├── native.xml
│ │ │ └── java.xml
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── .gitignore
│ └── README.md
├── function-sample-azure-http-trigger-gradle
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── application.properties
│ ├── host.json
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ └── .gitignore
├── function-sample-gcp-http
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ └── README.adoc
├── function-sample-aws-custom
│ ├── src
│ │ ├── test
│ │ │ └── resources
│ │ │ │ └── testBootstrap
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── bootstrap
│ │ └── assembly
│ │ │ └── zip.xml
│ └── README.adoc
├── function-sample-aws-custom-bean
│ ├── src
│ │ ├── test
│ │ │ └── resources
│ │ │ │ └── testBootstrap
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── bootstrap
│ │ └── assembly
│ │ │ └── zip.xml
│ └── README.adoc
├── function-sample-cloudevent
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.properties
│ │ │ └── java
│ │ │ └── io
│ │ │ └── spring
│ │ │ └── cloudevent
│ │ │ ├── Person.java
│ │ │ └── Employee.java
│ ├── images
│ │ ├── rabbit-send-binary.png
│ │ └── rabbit-send-structured.png
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── function-sample-gcp-background
│ └── src
│ │ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── MANIFEST.MF
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── BackgroundFunctionMain.java
├── function-sample-supplier-exporter
│ ├── src
│ │ ├── test
│ │ │ └── resources
│ │ │ │ └── bootstrap
│ │ └── main
│ │ │ └── resources
│ │ │ ├── META-INF
│ │ │ └── native-image
│ │ │ │ └── reflect-config.json
│ │ │ └── application.properties
│ └── README.md
├── function-sample-pof
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ └── src
│ │ └── main
│ │ └── java
│ │ └── functions
│ │ ├── Greeter.java
│ │ └── Application.java
├── function-sample-azure-web
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ ├── host.json
│ │ │ └── application.properties
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── azure
│ │ │ └── web
│ │ │ ├── AzureWebDemoApplication.java
│ │ │ └── CountryRepository.java
│ └── .gitignore
├── function-sample-azure-kafka-trigger
│ ├── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
│ ├── src
│ │ └── main
│ │ │ ├── doc
│ │ │ ├── output-topic.png
│ │ │ ├── kafka-ui-topics.png
│ │ │ └── kafka-publish-message.png
│ │ │ ├── azure
│ │ │ ├── local.settings.json
│ │ │ └── host.json
│ │ │ └── java
│ │ │ └── example
│ │ │ └── entity
│ │ │ └── KafkaHeaders.java
│ └── .gitignore
├── function-sample-cloudevent-stream
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ ├── src
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.yaml
│ │ │ └── java
│ │ │ └── io
│ │ │ └── spring
│ │ │ └── cloudevent
│ │ │ ├── Person.java
│ │ │ └── Employee.java
│ └── .gitignore
└── function-sample-azure-eventgrid-trigger
│ ├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
│ └── src
│ └── main
│ └── resources
│ ├── local.settings.json
│ ├── host.json
│ └── application.properties
├── spring-cloud-function-adapters
├── spring-cloud-function-grpc
│ ├── .jdk8
│ └── src
│ │ ├── test
│ │ └── resources
│ │ │ └── application.properties
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── function
│ │ │ └── grpc
│ │ │ ├── GrpcClientTemplate.java
│ │ │ └── GrpcMessageConverter.java
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── spring
│ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ └── proto
│ │ └── MessageService.proto
├── spring-cloud-function-adapter-azure
│ ├── .jdk8
│ ├── src
│ │ ├── main
│ │ │ └── resources
│ │ │ │ ├── META-INF
│ │ │ │ └── services
│ │ │ │ │ └── com.microsoft.azure.functions.spi.inject.FunctionInstanceInjector
│ │ │ │ └── spring-azure-function-banner.txt
│ │ └── test
│ │ │ └── resources
│ │ │ └── log4j.xml
│ └── README.adoc
├── spring-cloud-function-serverless-web
│ ├── .jdk8
│ ├── src
│ │ ├── test
│ │ │ ├── resources
│ │ │ │ └── templates
│ │ │ │ │ └── index.ftlh
│ │ │ └── java
│ │ │ │ └── org
│ │ │ │ └── springframework
│ │ │ │ └── cloud
│ │ │ │ └── function
│ │ │ │ └── test
│ │ │ │ └── app
│ │ │ │ └── FreemarkerController.java
│ │ └── main
│ │ │ └── resources
│ │ │ └── META-INF
│ │ │ └── spring
│ │ │ ├── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ │ └── aot.factories
│ ├── sample
│ │ └── pet-store
│ │ │ ├── .aws-sam
│ │ │ └── build.toml
│ │ │ ├── src
│ │ │ ├── assembly
│ │ │ │ └── bin.xml
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── oz
│ │ │ │ └── spring
│ │ │ │ └── petstore
│ │ │ │ └── model
│ │ │ │ └── Error.java
│ │ │ └── template.yml
│ └── README.md
├── spring-cloud-function-grpc-cloudevent-ext
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── application.properties
│ │ │ │ └── META-INF
│ │ │ │ │ └── spring
│ │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ │ └── proto
│ │ │ │ ├── CloudEventService.proto
│ │ │ │ └── CloudEvent.proto
│ │ └── test
│ │ │ └── java
│ │ │ └── org
│ │ │ └── springframework
│ │ │ └── cloud
│ │ │ └── grpc
│ │ │ └── ce
│ │ │ └── SpringCloudFunctionGrpcCloudeventApplicationTests.java
│ ├── .mvn
│ │ └── wrapper
│ │ │ ├── maven-wrapper.jar
│ │ │ └── maven-wrapper.properties
│ └── .gitignore
├── spring-cloud-function-adapter-aws
│ ├── src
│ │ ├── test
│ │ │ └── resources
│ │ │ │ └── META-INF
│ │ │ │ └── mask.keys
│ │ └── main
│ │ │ └── resources
│ │ │ └── META-INF
│ │ │ ├── spring
│ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ │ └── spring.factories
│ └── README.adoc
├── spring-cloud-function-adapter-azure-web
│ ├── src
│ │ └── main
│ │ │ └── resources
│ │ │ ├── application.properties
│ │ │ ├── META-INF
│ │ │ └── services
│ │ │ │ └── com.microsoft.azure.functions.spi.inject.FunctionInstanceInjector
│ │ │ └── spring-azure-function-banner.txt
│ └── README.adoc
├── spring-cloud-function-adapter-gcp
│ └── src
│ │ └── main
│ │ └── resources
│ │ └── META-INF
│ │ └── spring.factories
├── spring-cloud-function-aws-gradle-parent
│ ├── spring-cloud-function-aws-packaging-gradle-plugin
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── resources
│ │ │ │ └── META-INF
│ │ │ │ └── gradle-plugins
│ │ │ │ └── org.springframework.cloud.function.aws-lambda.packaging.properties
│ │ └── gradle
│ │ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── pom.xml
│ └── org.springframework.cloud.function.aws-lambda.packaging.gradle.plugin
│ │ └── pom.xml
└── pom.xml
├── docs
├── modules
│ └── ROOT
│ │ ├── assets
│ │ └── images
│ │ │ ├── remove.txt
│ │ │ ├── AWS-deploy.png
│ │ │ ├── aws_spring_lambda_edit.png
│ │ │ └── aws_spring_lambda_test.png
│ │ ├── pages
│ │ ├── spring-cloud-function
│ │ │ ├── introduction.adoc
│ │ │ ├── getting-started.adoc
│ │ │ ├── appendix.adoc
│ │ │ ├── functional-bean-definitions.adoc
│ │ │ ├── standalone-streaming-applications.adoc
│ │ │ └── serverless-platform-adapters.adoc
│ │ ├── index.adoc
│ │ ├── getting-started.adoc
│ │ └── spring-cloud-function.adoc
│ │ └── nav.adoc
├── src
│ └── main
│ │ ├── images
│ │ ├── ce.png
│ │ └── message.png
│ │ ├── asciidoc
│ │ └── README.adoc
│ │ ├── antora
│ │ └── resources
│ │ │ └── antora-resources
│ │ │ └── antora.yml
│ │ └── ruby
│ │ └── generate_readme.sh
├── package.json
├── antora.yml
└── antora-playbook.yml
├── spring-cloud-function-context
└── src
│ ├── test
│ ├── resources
│ │ ├── META-INF
│ │ │ └── mask.keys
│ │ ├── greeter.jar
│ │ └── avro
│ │ │ └── sensor.avsc
│ └── java
│ │ └── org
│ │ └── springframework
│ │ └── cloud
│ │ └── function
│ │ ├── context
│ │ └── scan
│ │ │ └── TestFunction.java
│ │ └── inject
│ │ └── FooConfiguration.java
│ └── main
│ ├── resources
│ └── META-INF
│ │ ├── spring
│ │ ├── aot.factories
│ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ ├── spring.factories
│ │ └── spring-configuration-metadata.json
│ └── java
│ └── org
│ └── springframework
│ └── cloud
│ └── function
│ ├── context
│ ├── FunctionRegistry.java
│ └── catalog
│ │ └── FunctionCatalogEvent.java
│ └── utils
│ └── SocketUtils.java
├── .mvn
├── jvm.config
├── maven.config
├── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
└── settings.xml
├── CONTRIBUTING.adoc
├── spring-cloud-function-deployer
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.properties
│ │ └── maven-wrapper.jar
├── src
│ ├── main
│ │ └── resources
│ │ │ └── META-INF
│ │ │ ├── spring
│ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
│ │ │ └── spring.factories
│ └── it
│ │ ├── bootjar
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ ├── ReverseFunction.java
│ │ │ ├── UpperCaseFunction.java
│ │ │ └── SimpleFunctionAppApplication.java
│ │ ├── simplestjarcs
│ │ ├── src
│ │ │ └── main
│ │ │ │ └── java
│ │ │ │ └── functions
│ │ │ │ └── UpperCaseFunction.java
│ │ └── pom.xml
│ │ ├── bootapp
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── UpperCaseFunction.java
│ │ ├── bootjarnostart
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── UpperCaseFunction.java
│ │ ├── bootapp-with-scf
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── UpperCaseFunction.java
│ │ ├── simplestjar
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── EchoCloudEventFunction.java
│ │ ├── bootapp-with-javax
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── UpperCaseFunction.java
│ │ ├── settings.xml
│ │ ├── bootapp-multi
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── function
│ │ │ └── example
│ │ │ └── MyFn.java
│ │ └── bootjar-multi
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── function
│ │ └── example
│ │ └── Repeater.java
├── mavenrepo
│ └── oz
│ │ └── demo
│ │ └── demo-stream
│ │ ├── 0.0.1-SNAPSHOT
│ │ ├── demo-stream-0.0.1-SNAPSHOT.jar
│ │ └── maven-metadata-local.xml
│ │ └── maven-metadata-local.xml
└── .gitignore
├── spring-cloud-function-integration
└── src
│ └── main
│ └── resources
│ └── META-INF
│ └── spring
│ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
├── src
└── checkstyle
│ └── checkstyle-suppressions.xml
├── .editorconfig
├── .travis.yml
├── Guardfile
├── .gitignore
└── spring-cloud-starter-function-web
└── pom.xml
/.springformat:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-core/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-rsocket/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/dco.yml:
--------------------------------------------------------------------------------
1 | require:
2 | members: false
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pojo/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-sam/README.md:
--------------------------------------------------------------------------------
1 | TBD
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/input.json:
--------------------------------------------------------------------------------
1 | "hello"
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/.jdk8:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-rsocket/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/remove.txt:
--------------------------------------------------------------------------------
1 | please remove once this directory is not empty
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/introduction.adoc:
--------------------------------------------------------------------------------
1 |
2 | include::../intro.adoc[]
3 |
4 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/test/resources/META-INF/mask.keys:
--------------------------------------------------------------------------------
1 | eventSourceARN
2 | asdf1, SS
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-sdk/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure/.gitignore:
--------------------------------------------------------------------------------
1 | extensions.csproj
2 | obj/
3 | lib/
4 |
5 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/test/resources/static/test.html:
--------------------------------------------------------------------------------
1 |
2 |
Test
3 |
4 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | -Xmx1024m -XX:CICompilerCount=1 -noverify -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/src/main/images/ce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/docs/src/main/images/ce.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'gradle-demo'
2 |
--------------------------------------------------------------------------------
/.mvn/maven.config:
--------------------------------------------------------------------------------
1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring
2 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/main/resources/META-INF/.gitignore:
--------------------------------------------------------------------------------
1 | /native-image/
2 |
--------------------------------------------------------------------------------
/docs/src/main/images/message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/docs/src/main/images/message.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/src/main/resources/META-INF/mask.keys:
--------------------------------------------------------------------------------
1 | routeKey
2 | rawQueryString
3 | path
4 | resource
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.cloud=DEBUG
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-gcp-http/src/main/resources/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Main-Class: com.example.CloudFunctionMain
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'function-sample-spring-integration'
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/test/resources/META-INF/mask.keys:
--------------------------------------------------------------------------------
1 | eventSourceARN, ApproximateCreationDateTime
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom/src/test/resources/testBootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | while true
4 | do
5 | sleep 1
6 | done
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure/src/main/azure/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "functionTimeout": "00:05:00",
3 | "version": "2.0"
4 | }
5 |
--------------------------------------------------------------------------------
/spring-cloud-function-rsocket/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | io.rsocket.broker.enabled=false
2 | io.rsocket.broker.client.enabled=false
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.cloud=DEBUG
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom-bean/src/test/resources/testBootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | while true
4 | do
5 | sleep 1
6 | done
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.cloud=DEBUG
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #spring.cloud.function.definition=asPOJOMessage
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-gcp-background/src/main/resources/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Main-Class: com.example.BackgroundFunctionMain
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-supplier-exporter/src/test/resources/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | while true
4 | do
5 | sleep 1
6 | done
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.main.allow-circular-references=true
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/AWS-deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/docs/modules/ROOT/assets/images/AWS-deploy.png
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.cloud.function.grpc=DEBUG
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.adoc:
--------------------------------------------------------------------------------
1 | If you have not previously done so, please fill out and
2 | submit the https://cla.pivotal.io/sign/spring[Contributor License Agreement].
3 |
4 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.banner.location=classpath:/spring-azure-function-banner.txt
2 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/aws_spring_lambda_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/docs/modules/ROOT/assets/images/aws_spring_lambda_edit.png
--------------------------------------------------------------------------------
/docs/modules/ROOT/assets/images/aws_spring_lambda_test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/docs/modules/ROOT/assets/images/aws_spring_lambda_test.png
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/README.adoc:
--------------------------------------------------------------------------------
1 | !!! INTERNAL !!!
2 |
3 | Contains only Kotlin tests.
4 | Since version 3.1.3, user's should not be declaring explicit dependency on this module.
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/src/test/resources/templates/index.ftlh:
--------------------------------------------------------------------------------
1 | hello from freemarker
2 |
3 | <#list 1..10 as x>
4 | ${x}
5 | #list>
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/test/resources/greeter.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-context/src/test/resources/greeter.jar
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-deployer/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom-bean/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.main.web-application-type=none
2 | logging.level.org.springframework.cloud=DEBUG
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/getting-started.adoc:
--------------------------------------------------------------------------------
1 | [[getting-started]]
2 | = Getting Started
3 | :page-section-summary-toc: 1
4 |
5 | include:../:getting-started.adoc[]
6 |
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.cloud=DEBUG
2 | spring.functional.enabled = false
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.deployer.FunctionDeployerConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.cloud.function.stream.processor.name:uppercase
2 | spring.cloud.function.scan.packages:com.example.functions
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/shell/native/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | ./function-sample-aws-native -Dlogging.level.org.springframework=DEBUG
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=org.springframework.cloud.function.context.FunctionTypeProcessor
--------------------------------------------------------------------------------
/spring-cloud-function-integration/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.integration.dsl.FunctionFlowAutoConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/scf-aws-day1/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/scf-aws-routing/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/appendix.adoc:
--------------------------------------------------------------------------------
1 | [[appendix]]
2 | = Appendix
3 | :page-section-summary-toc: 1
4 |
5 | Relevant Links:
6 |
7 | [horizontal]
8 | https://projectreactor.io/[Reactor] :: Project Reactor
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[4.*, 5.0.0)"
6 | }
7 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-aws/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pof/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-pof/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pojo/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-pojo/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/functional-bean-definitions.adoc:
--------------------------------------------------------------------------------
1 | [[functional-bean-definitions]]
2 | = Functional Bean Definitions
3 | :page-section-summary-toc: 1
4 |
5 | include:../:functional.adoc[leveloffset=+1]
6 |
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/src/main/java/org/springframework/cloud/function/grpc/GrpcClientTemplate.java:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.grpc;
2 |
3 | public class GrpcClientTemplate {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.EnvironmentPostProcessor=org.springframework.cloud.function.deployer.FunctionDeployerConfiguration$LegacyPropertyEnvironmentPostProcessor
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-web/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/images/rabbit-send-binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent/images/rabbit-send-binary.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/images/rabbit-send-binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-kotlin-web/images/rabbit-send-binary.png
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.adapter.aws.AWSCompanionAutoConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/resources/META-INF/services/com.microsoft.azure.functions.spi.inject.FunctionInstanceInjector:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.adapter.azure.web.AzureWebProxyInvoker
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/src/main/resources/META-INF/services/com.microsoft.azure.functions.spi.inject.FunctionInstanceInjector:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.adapter.azure.AzureFunctionInstanceInjector
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-gcp/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.loader.tools.LayoutFactory=\
2 | org.springframework.cloud.function.adapter.gcp.layout.GcfJarLayoutFactory
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.grpc.ce.CloudEventGrpcAutoConfiguration
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-aws-native/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-kotlin-web/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.context.ApplicationContextInitializer=\
2 | org.springframework.cloud.function.adapter.aws.CustomRuntimeInitializer
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.serverless.web.ServerlessAutoConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-aws-routing/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-kafka-trigger/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-sdk/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent-sdk/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/images/rabbit-send-structured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent/images/rabbit-send-structured.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/images/rabbit-send-structured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-kotlin-web/images/rabbit-send-structured.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-functional-sample-aws/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/src/main/resources/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[3.*, 4.0.0)"
6 | }
7 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure/src/main/azure/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "AzureWebJobsStorage": "",
5 | "AzureWebJobsDashboard": "",
6 | "FUNCTIONS_WORKER_RUNTIME": "java"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent-stream/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-grpc-cloudevent/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-supplier-exporter/src/main/resources/META-INF/native-image/reflect-config.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "com.example.demo.Foo",
4 | "allDeclaredConstructors": true,
5 | "allDeclaredMethods": true
6 | }
7 | ]
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=org.springframework.cloud.function.serverless.web.AWSTypesProcessor
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | mavenLocal()
4 | maven { url 'https://repo.spring.io/milestone' }
5 | gradlePluginPortal()
6 | }
7 | }
8 | rootProject.name = 'demo-function'
9 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-blob-trigger/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-http-trigger/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/output-topic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/output-topic.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-time-trigger/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-cloudevent-rsocket/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/src/main/resources/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[3.*, 4.0.0)"
6 | }
7 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/kafka-ui-topics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/kafka-ui-topics.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/src/main/resources/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[3.*, 4.0.0)"
6 | }
7 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-spring-integration/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-rsocket/NOTES.txt:
--------------------------------------------------------------------------------
1 |
2 | spring.cloud.function.rsocket.bind-address=localhost
3 | spring.cloud.function.rsocket.bind-port=1234
4 |
5 | spring.cloud.function.rsocket.target-address=localhost
6 | spring.cloud.function.rsocket.target-port=1235
7 |
8 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/src/checkstyle/checkstyle-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-aws-serverless-web-native/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/kafka-publish-message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/doc/kafka-publish-message.png
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-functional-aws-routing/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/mavenrepo/oz/demo/demo-stream/0.0.1-SNAPSHOT/demo-stream-0.0.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-deployer/mavenrepo/oz/demo/demo-stream/0.0.1-SNAPSHOT/demo-stream-0.0.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/spring-cloud-function-rsocket/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.rsocket.RSocketAutoConfiguration
2 | org.springframework.cloud.function.rsocket.RSocketCustomizerConfiguration
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/src/main/resources/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "AzureWebJobsStorage": "",
5 | "FUNCTIONS_WORKER_RUNTIME": "java"
6 | }
7 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | #spring.cloud.function.web.export.enabled=true
2 | #spring.cloud.function.web.export.debug=true
3 | spring.main.web-application-type=none
4 | logging.level.org.springframework.cloud=DEBUG
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-supplier-exporter/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.cloud.function.web.export.enabled=true
2 | spring.cloud.function.web.export.debug=true
3 | spring.main.web-application-type=none
4 | logging.level.org.springframework.cloud=DEBUG
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.grpc.GrpcAutoConfiguration
2 | org.springframework.cloud.function.grpc.GrpcFunctionAutoConfiguration
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/src/main/resources/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true",
5 | "AzureWebJobsDashboard": "",
6 | "FUNCTIONS_WORKER_RUNTIME": "java"
7 | }
8 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/src/main/resources/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true",
5 | "AzureWebJobsDashboard": "",
6 | "FUNCTIONS_WORKER_RUNTIME": "java"
7 | }
8 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/shell/native/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | ./function-sample-aws-serverless-web-native -Dlogging.level.org.springframework=DEBUG -Dlogging.level.com.amazonaws.serverless.proxy.spring=DEBUG
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pojo/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.cloud.stream.bindings.input.destination:foos
2 | spring.cloud.stream.bindings.output.destination:bars
3 | spring.cloud.function.stream.processor.name:uppercase
4 | management.security.enabled:false
5 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/index.adoc:
--------------------------------------------------------------------------------
1 | [[spring-cloud-function-reference-documentation]]
2 | = Spring Cloud Function Reference Documentation
3 | :page-section-summary-toc: 1
4 |
5 | Mark Fisher, Dave Syer, Oleg Zhurakousky, Anshul Mehra, Dan Dobrin, Chris Bono, Artem Bilan
6 |
7 | *{project-version}*
8 |
9 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/src/main/resources/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[4.*, 5.2.0)"
6 | },
7 | "functionTimeout": "00:10:00"
8 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | [*]
7 | indent_style = tab
8 | indent_size = 4
9 | end_of_line = lf
10 | insert_final_newline = true
11 |
12 | [*.yml]
13 | indent_style = space
14 | indent_size = 2
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pof/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pojo/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/spring-cloud-function-aws-packaging-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.cloud.function.aws-lambda.packaging.properties:
--------------------------------------------------------------------------------
1 | implementation-class=org.springframework.cloud.function.gradle.AwsPackagingPlugin
2 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-sdk/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
4 | sudo: required
5 | cache:
6 | directories:
7 | - $HOME/.m2
8 | install: true
9 | before_script: ./mvnw install -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
10 | script: ./mvnw install -q -nsu -Dmaven.test.redirectTestOutputToFile=true
11 | dist: trusty
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/src/test/resource/sample.txt:
--------------------------------------------------------------------------------
1 | Authoritarianism begins when we can no longer tell the difference between the true and the appealing.
2 | At the same time, the cynic who decides that there is no truth at all is the citizen who welcomes the tyrant.
3 | ― Timothy Snyder, The Road to Unfreedom
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.web.flux.ReactorAutoConfiguration
2 | org.springframework.cloud.function.web.mvc.ReactorAutoConfiguration
3 | org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration
4 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Feb 06 12:27:20 CET 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.context.WrapperDetector=\
2 | org.springframework.cloud.function.context.config.FluxWrapperDetector
3 | org.springframework.context.ApplicationContextInitializer=\
4 | org.springframework.cloud.function.context.config.ContextFunctionCatalogInitializer
5 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/spring-cloud-function-aws-packaging-gradle-plugin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/spring-cloud/spring-cloud-function/HEAD/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/spring-cloud-function-aws-packaging-gradle-plugin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.datasource.url=jdbc:h2:mem:testdb
2 | spring.datasource.driverClassName=org.h2.Driver
3 | spring.datasource.username=sa
4 | spring.datasource.password=password
5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
6 | spring.jpa.defer-datasource-initialization=true
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/resources/META-INF/additional-spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": [
3 | {
4 | "name": "spring.cloud.function.web.path",
5 | "type": "java.lang.String",
6 | "description": "Path to web resources for functions (should start with / if not empty).",
7 | "defaultValue": ""
8 | }
9 | ]
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/shell/java/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | java -Dspring.main.web-application-type=none -Dlogging.level.org.springframework=DEBUG \
6 | -noverify -XX:TieredStopAtLevel=1 -Xss256K -XX:MaxMetaspaceSize=128M \
7 | -cp .:`echo lib/*.jar | tr ' ' :` com.example.demo.NativeUppercaseApplication
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/shell/java/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | java -Dspring.main.web-application-type=none -Dlogging.level.org.springframework=DEBUG \
6 | -noverify -XX:TieredStopAtLevel=1 -Xss256K -XX:MaxMetaspaceSize=128M \
7 | -cp .:`echo lib/*.jar | tr ' ' :` com.example.demo.DemoApplication
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/ComponentUppercase.kt:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.kotlin
2 |
3 | import org.springframework.stereotype.Component
4 |
5 | @Component
6 | class ComponentUppercase : (String) -> String {
7 | override fun invoke(p1: String): String {
8 | return p1.uppercase()
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "antora": "3.2.0-alpha.4",
4 | "@antora/atlas-extension": "1.0.0-alpha.2",
5 | "@antora/collector-extension": "1.0.0-alpha.3",
6 | "@asciidoctor/tabs": "1.0.0-beta.6",
7 | "@springio/antora-extensions": "1.11.1",
8 | "@springio/asciidoctor-extensions": "1.0.0-alpha.10"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/spring-cloud-function-aws-packaging-gradle-plugin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/test/java/com/example/demo/NativeUppercaseApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class NativeUppercaseApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/src/test/java/com/example/grpc/demo/DemoGrpcApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.grpc.demo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class DemoGrpcApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom/src/main/resources/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | java -Dspring.main.web-application-type=none -Dspring.jmx.enabled=false \
6 | -noverify -XX:TieredStopAtLevel=1 -Xss256K -XX:MaxMetaspaceSize=128M \
7 | -Djava.security.egd=file:/dev/./urandom \
8 | -cp .:`echo lib/*.jar | tr ' ' :` com.example.LambdaApplication
9 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom-bean/src/main/resources/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ${LAMBDA_TASK_ROOT:-.}
4 |
5 | java -Dspring.main.web-application-type=none -Dspring.jmx.enabled=false \
6 | -noverify -XX:TieredStopAtLevel=1 -Xss256K -XX:MaxMetaspaceSize=128M \
7 | -Djava.security.egd=file:/dev/./urandom \
8 | -cp .:`echo lib/*.jar | tr ' ' :` com.example.LambdaApplication
9 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/test/resources/avro/sensor.avsc:
--------------------------------------------------------------------------------
1 | {
2 | "namespace" : "com.example",
3 | "type" : "record",
4 | "name" : "Sensor",
5 | "fields" : [
6 | {"name":"id","type":"string"},
7 | {"name":"temperature", "type":"float", "default":0.0},
8 | {"name":"acceleration", "type":"float","default":0.0},
9 | {"name":"velocity","type":"float","default":0.0}
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/mavenrepo/oz/demo/demo-stream/maven-metadata-local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | oz.demo
4 | demo-stream
5 |
6 |
7 | 0.0.1-SNAPSHOT
8 |
9 | 20200721131233
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | spring:
2 | cloud:
3 | stream:
4 | bindings:
5 | hire-in-0:
6 | binder: rabbit1
7 | hire-out-0:
8 | binder: kafka1
9 | binders:
10 | rabbit1:
11 | type: rabbit
12 | kafka1:
13 | type: kafka
14 | function:
15 | definition: hire
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootjar/src/main/java/function/example/ReverseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.function.Function;
4 |
5 | public class ReverseFunction implements Function {
6 |
7 | @Override
8 | public String apply(String value) {
9 | System.out.println("Reversing " + value);
10 | return new StringBuilder(value).reverse().toString();
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/KotlinComponentFunction.kt:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.kotlin
2 |
3 | import org.springframework.stereotype.Component
4 | import java.util.function.Function
5 |
6 | @Component
7 | class KotlinComponentFunction : Function {
8 |
9 | override fun apply(t: String): String {
10 | return t.uppercase();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/src/main/resources/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "extensionBundle": {
4 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
5 | "version": "[4.*, 5.0.0)"
6 | },
7 | "functionTimeout": "00:05:00",
8 | "logging": {
9 | "applicationInsights": {
10 | "samplingSettings": {
11 | "isEnabled": true
12 | }
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/src/test/java/com/example/azure/di/httptriggerdemo/HttptriggerDemoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.azure.di.httptriggerdemo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class HttptriggerDemoApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/src/test/java/com/example/azure/di/timetriggerdemo/TimetriggerDemoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.azure.di.timetriggerdemo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class TimetriggerDemoApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/simplestjarcs/src/main/java/functions/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package functions;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | public class UpperCaseFunction implements Function {
7 |
8 | @Override
9 | public String apply(String value) {
10 | System.out.println("Uppercasing " + value);
11 | return value.toUpperCase(Locale.ROOT);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/ComponentWithUnitReturn.kt:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.kotlin
2 |
3 | import org.springframework.messaging.Message
4 | import org.springframework.stereotype.Component
5 |
6 | @Component
7 | class ComponentWithUnitReturn() : (Message) -> Unit {
8 | override fun invoke(message: Message) {
9 | println(message.payload)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/local.settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IsEncrypted": false,
3 | "Values": {
4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true",
5 | "AzureWebJobsDashboard": "",
6 | "FUNCTIONS_WORKER_RUNTIME": "java",
7 |
8 | "BrokerList": "localhost:9092",
9 | "ConfluentCloudUsername": "test",
10 | "ConfluentCloudPassword": "test",
11 | "TriggerKafkaTopic": "trigger"
12 | }
13 | }
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootapp/src/main/java/function/example/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | public class UpperCaseFunction implements Function {
7 |
8 | @Override
9 | public String apply(String value) {
10 | System.out.println("Uppercasing " + value);
11 | return value.toUpperCase(Locale.ROOT);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootjar/src/main/java/function/example/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | public class UpperCaseFunction implements Function {
7 |
8 | @Override
9 | public String apply(String value) {
10 | System.out.println("Uppercasing " + value);
11 | return value.toUpperCase(Locale.ROOT);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/.mvn/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | sonatype-nexus-staging
6 | ${env.sonatype_username}
7 | ${env.sonatype_password}
8 |
9 |
10 | repo.spring.io
11 | ${env.spring_username}
12 | ${env.spring_password}
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootjarnostart/src/main/java/function/example/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | public class UpperCaseFunction implements Function {
7 |
8 | @Override
9 | public String apply(String value) {
10 | System.out.println("Uppercasing " + value);
11 | return value.toUpperCase(Locale.ROOT);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/src/test/java/com/example/azure/di/azureblobtriggerdemo/AzureBlobTriggerDemoApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.azure.di.azureblobtriggerdemo;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class AzureBlobTriggerDemoApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM springcloudstream/azure-functions-java17:1.0.0
2 |
3 | COPY ./target/azure-functions /src/java-function-app
4 |
5 | RUN mkdir -p /home/site/wwwroot && \
6 | cd /src/java-function-app && \
7 | cd $(ls -d */|head -n 1) && \
8 | cp -a . /home/site/wwwroot
9 |
10 | ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
11 | AzureFunctionsJobHost__Logging__Console__IsEnabled=true
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /build/
3 | !gradle/wrapper/gradle-wrapper.jar
4 |
5 | ### STS ###
6 | .apt_generated
7 | .classpath
8 | .factorypath
9 | .project
10 | .settings
11 | .springBeans
12 | .sts4-cache
13 |
14 | ### IntelliJ IDEA ###
15 | .idea
16 | *.iws
17 | *.iml
18 | *.ipr
19 | /out/
20 |
21 | ### NetBeans ###
22 | /nbproject/private/
23 | /nbbuild/
24 | /dist/
25 | /nbdist/
26 | /.nb-gradle/
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootapp-with-scf/src/main/java/function/example/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | public class UpperCaseFunction implements Function {
7 |
8 | @Override
9 | public String apply(String value) {
10 | System.out.println("Uppercasing " + value);
11 | return value.toUpperCase(Locale.ROOT);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/src/main/java/oz/spring/aws/FunctionAwsApplication.java:
--------------------------------------------------------------------------------
1 | package oz.spring.aws;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class FunctionAwsApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(FunctionAwsApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/src/main/java/oz/spring/aws/FunctionAwsApplication.java:
--------------------------------------------------------------------------------
1 | package oz.spring.aws;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class FunctionAwsApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(FunctionAwsApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/refactoring_notes:
--------------------------------------------------------------------------------
1 | If a function returns Flux, we must represent output as JSON Array/Collection since we never know how many elements such flux will contain per each invocation.
2 | For that same reason we can't use TEXT/PLAIN as CT
3 |
4 | NON-WEB
5 | When sendng collection of objects to function who's input is not collection, the inpt will be converted to flux and the result is alos going to be flux.
6 | That is to ensure that the function is invoked with idividual. . .
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/main/java/com/example/demo/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class DemoApplication {
8 |
9 | public static void main(String[] args) throws Exception {
10 | SpringApplication.run(DemoApplication.class, args);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Guardfile:
--------------------------------------------------------------------------------
1 | require 'asciidoctor'
2 | require 'erb'
3 | require './src/main/ruby/readme.rb'
4 |
5 | options = {:mkdirs => true, :safe => :unsafe, :attributes => ['linkcss', 'allow-uri-read']}
6 |
7 | guard 'shell' do
8 | watch(/^src\/[A-Z-a-z][^#]*\.adoc$/) {|m|
9 | SpringCloud::Build.render_file('src/main/asciidoc/README.adoc', :to_file => './README.adoc')
10 | Asciidoctor.render_file('src/main/asciidoc/spring-cloud-cli.adoc', options.merge(:to_dir => 'target/generated-docs'))
11 | }
12 | end
13 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/simplestjar/src/main/java/function/example/EchoCloudEventFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Map;
4 | import java.util.function.Function;
5 |
6 | import io.cloudevents.CloudEvent;
7 |
8 | public class EchoCloudEventFunction implements Function {
9 |
10 | @Override
11 | public CloudEvent apply(CloudEvent value) {
12 | System.out.println("Received " + value);
13 | return value;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**
5 | !**/src/test/**
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 |
30 | ### VS Code ###
31 | .vscode/
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-eventgrid-trigger/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # Spring Cloud Function configuration
2 | spring.cloud.function.definition=processEvent,createEvent
3 |
4 | # Logging configuration
5 | logging.level.com.example.azure.eventgrid=INFO
6 | logging.level.org.springframework.cloud.function=DEBUG
7 | logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
8 |
9 | # Spring Boot configuration
10 | spring.main.web-application-type=none
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\
2 | org.springframework.cloud.function.web.flux.ReactorAutoConfiguration,\
3 | org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration
4 | org.springframework.context.ApplicationContextInitializer=\
5 | org.springframework.cloud.function.web.function.FunctionEndpointInitializer,\
6 | org.springframework.cloud.function.web.source.FunctionExporterInitializer
7 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: waiting-for-triage
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | Please provide details of the problem, including the version of Spring Cloud that you
12 | are using.
13 |
14 | **Sample**
15 | If possible, please provide a test case or sample application that reproduces
16 | the problem. This makes it much easier for us to diagnose the problem and to verify that
17 | we have fixed it.
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/src/main/resources/META-INF/thin-rabbit.properties:
--------------------------------------------------------------------------------
1 | boms.spring-cloud-dependencies:org.springframework.cloud:spring-cloud-dependencies:Edgware.SR3
2 | dependencies.spring-cloud-function-stream:org.springframework.cloud:spring-cloud-function-stream
3 | dependencies.spring-cloud-stream-rabbit:org.springframework.cloud:spring-cloud-starter-stream-rabbit
4 | exclusions.spring-cloud-function-web:org.springframework.cloud:spring-cloud-starter-function-web
5 | exclusions.http-client:com.rabbitmq:http-client
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/src/main/java/oz/spring/aws/functions/FunctionConfiguration.java:
--------------------------------------------------------------------------------
1 | package oz.spring.aws.functions;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | @Configuration
10 | public class FunctionConfiguration {
11 |
12 | @Bean
13 | public Function uppercase() {
14 | return value -> value.toUpperCase(Locale.ROOT);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/azure/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "functionTimeout": "00:05:00",
3 | "version": "2.0",
4 | "extensions": {
5 | "kafka": {
6 | "maxBatchSize": 64,
7 | "SubscriberIntervalInSeconds": 1,
8 | "ExecutorChannelCapacity": 1,
9 | "ChannelFullRetryIntervalInMs": 50
10 | }
11 | },
12 | "extensionBundle": {
13 | "id": "Microsoft.Azure.Functions.ExtensionBundle",
14 | "version": "[3.3.0, 4.0.0)"
15 | }
16 | }
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/README.adoc:
--------------------------------------------------------------------------------
1 | === Introduction
2 |
3 | Light weight Azure Function forwarding proxy which can deploy any existing Spring Boot web application as Azure Functions.
4 | Infernally uses the Azure Http Trigger mapping.
5 |
6 | This module is identified as the only additional dependency to the existing web-app.
7 |
8 | A sample is provided in https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-azure-web[azure-web sample]
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/src/test/resources/log4j.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration
2 | org.springframework.cloud.function.cloudevent.CloudEventsFunctionExtensionConfiguration
3 | org.springframework.cloud.function.context.config.KotlinLambdaToFunctionAutoConfiguration
4 | org.springframework.cloud.function.context.config.FunctionsEndpointAutoConfiguration
5 | org.springframework.cloud.function.observability.ObservationAutoConfiguration
6 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/main/java/com/example/demo/HelloController.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import org.springframework.web.bind.annotation.GetMapping;
4 | import org.springframework.web.bind.annotation.RestController;
5 |
6 | @RestController
7 | public class HelloController {
8 |
9 | public HelloController() {
10 | System.out.println("Creating controller");
11 | }
12 |
13 | @GetMapping("/hello")
14 | public String something(){
15 | return "Hello World";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/docs/antora.yml:
--------------------------------------------------------------------------------
1 | name: cloud-function
2 | version: true
3 | title: spring-cloud-function
4 | nav:
5 | - modules/ROOT/nav.adoc
6 | ext:
7 | collector:
8 | run:
9 | command: ./mvnw --no-transfer-progress -B process-resources -Pdocs -pl docs -Dantora-maven-plugin.phase=none -Dgenerate-docs.phase=none -Dgenerate-readme.phase=none -Dgenerate-cloud-resources.phase=none -Dmaven-dependency-plugin-for-docs.phase=none -Dmaven-dependency-plugin-for-docs-classes.phase=none -DskipTests
10 | local: true
11 | scan:
12 | dir: ./target/classes/antora-resources/
13 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/src/main/java/io/spring/cloudevent/Person.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | public class Person {
4 |
5 | private String firstName;
6 |
7 | private String lastName;
8 |
9 | public String getLastName() {
10 | return lastName;
11 | }
12 |
13 | public void setLastName(String lastName) {
14 | this.lastName = lastName;
15 | }
16 |
17 | public String getFirstName() {
18 | return firstName;
19 | }
20 |
21 | public void setFirstName(String firstName) {
22 | this.firstName = firstName;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/src/main/java/io/spring/cloudevent/Person.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | public class Person {
4 |
5 | private String firstName;
6 |
7 | private String lastName;
8 |
9 | public String getLastName() {
10 | return lastName;
11 | }
12 |
13 | public void setLastName(String lastName) {
14 | this.lastName = lastName;
15 | }
16 |
17 | public String getFirstName() {
18 | return firstName;
19 | }
20 |
21 | public void setFirstName(String firstName) {
22 | this.firstName = firstName;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/src/main/java/io/spring/cloudevent/Person.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | public class Person {
4 |
5 | private String firstName;
6 |
7 | private String lastName;
8 |
9 | public String getLastName() {
10 | return lastName;
11 | }
12 |
13 | public void setLastName(String lastName) {
14 | this.lastName = lastName;
15 | }
16 |
17 | public String getFirstName() {
18 | return firstName;
19 | }
20 |
21 | public void setFirstName(String firstName) {
22 | this.firstName = firstName;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-sam/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/src/main/java/com/example/azure/web/AzureWebDemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.azure.web;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
6 |
7 | @SpringBootApplication
8 | @EnableJpaRepositories
9 | public class AzureWebDemoApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(AzureWebDemoApplication.class, args);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | !**/src/main/**/target/
4 | !**/src/test/**/target/
5 |
6 | ### STS ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 |
15 | ### IntelliJ IDEA ###
16 | .idea
17 | *.iws
18 | *.iml
19 | *.ipr
20 |
21 | ### NetBeans ###
22 | /nbproject/private/
23 | /nbbuild/
24 | /dist/
25 | /nbdist/
26 | /.nb-gradle/
27 | build/
28 | !**/src/main/**/build/
29 | !**/src/test/**/build/
30 |
31 | ### VS Code ###
32 | .vscode/
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-sdk/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/src/main/kotlin/com/example/kotlin/DemoKotlinConfiguration.kt:
--------------------------------------------------------------------------------
1 | package com.example.kotlin
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.context.annotation.Bean
6 | import java.util.function.Function
7 | import org.springframework.context.annotation.Configuration
8 |
9 | @Configuration
10 | class DemoKotlinConfiguration {
11 | @Bean
12 | fun uppercase(): (String) -> String {
13 | return { it.toUpperCase() }
14 | }
15 | }
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-blob-trigger/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-time-trigger/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootjar/src/main/java/function/example/SimpleFunctionAppApplication.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.function.Function;
4 |
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.SpringBootConfiguration;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.context.annotation.Bean;
9 |
10 | public class SimpleFunctionAppApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(SimpleFunctionAppApplication.class, args);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/README.adoc:
--------------------------------------------------------------------------------
1 | This example demonstrates routing capabilities of spring-cloud-function when deployed as AWS Lambdas.
2 | It is almost identical to the `function-sample-aws-routing` , so most of what's described it its README applies to this example as well.
3 |
4 | The main difference though is that this example uses functional bean definition feature of Spring.
5 |
6 | It also uses `MessageRoutingCallback` in place of `spring_cloud_function_definition` and/or `spring_cloud_function_routingExpression`, effectively giving you more flexibility with your routing decisions.
7 |
8 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-supplier-exporter/README.md:
--------------------------------------------------------------------------------
1 | AWS Lambda custom runtime.
2 |
3 | ```
4 | $ ./build.sh
5 | $ ./mvnw package -P native
6 | ```
7 |
8 | builds a native-zip ZIP file in target. Upload it to AWS and set the handler to "foobar".
9 |
10 | To test locally, run the `TestServer` and then the `DemoApplication` (either in a JVM or natively). Then POST some data into the test server:
11 |
12 | ```
13 | $ curl localhost:8000/add -d world -H "Content-Type: text/plain"
14 | ```
15 |
16 | There is a unit test that does the same thing. Also the `build.sh` script orchestrates the same test for the native image.
17 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/KotlinComponentMessageFunction.kt:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.kotlin
2 |
3 | import org.springframework.messaging.Message
4 | import org.springframework.messaging.MessageHeaders
5 | import org.springframework.messaging.support.MessageBuilder
6 | import org.springframework.stereotype.Component
7 |
8 | import java.util.function.Function
9 |
10 | @Component
11 | class KotlinComponentMessageFunction : (List>) -> List> {
12 | override fun invoke(input: List>): List> {
13 | return input
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /application.yml
2 | /application.properties
3 | asciidoctor.css
4 | *~
5 | .#*
6 | *#
7 | src/main/resources/META-INF/native-image
8 | target/
9 | build/
10 | bin/
11 | .sts4-cache/
12 | .attach_pid*
13 | .m2/
14 | .gradle/
15 | _site/
16 | .vscode/
17 | .classpath
18 | .project
19 | .settings/
20 | .springBeans
21 | .DS_Store
22 | *.sw*
23 | *.iml
24 | *.ipr
25 | *.iws
26 | .idea/
27 | .factorypath
28 | .checkstyle
29 | coverage-error.log
30 | .apt_generated
31 | credentials.yml
32 | .flattened-pom.xml
33 | pom.xml.versionsBackup
34 |
35 | node
36 | node_modules
37 | build
38 | /package.json
39 | package-lock.json
40 | *samconfig.toml
41 | *.aws-sam/
42 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/standalone-streaming-applications.adoc:
--------------------------------------------------------------------------------
1 | [[standalone-streaming-applications]]
2 | = Standalone Streaming Applications
3 | :page-section-summary-toc: 1
4 |
5 | To send or receive messages from a broker (such as RabbitMQ or Kafka) you can leverage `spring-cloud-stream` project and it's integration with Spring Cloud Function.
6 | Please refer to https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/current/reference/html/spring-cloud-stream.html#spring_cloud_function[Spring Cloud Function] section of the https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream] reference manual for more details and examples.
7 |
8 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function/serverless-platform-adapters.adoc:
--------------------------------------------------------------------------------
1 | [[serverless-platform-adapters]]
2 | = Serverless Platform Adapters
3 | :page-section-summary-toc: 1
4 |
5 | As well as being able to run as standalone process, Spring Cloud
6 | Function application can be adapted to run one of the existing
7 | serverless platforms. In the project there are adapters for
8 | https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-adapter-aws[AWS
9 | Lambda], and https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-adapters/spring-cloud-function-adapter-azure[Azure].
10 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/src/main/kotlin/com/example/kotlin/DemoKotlinApplication.kt:
--------------------------------------------------------------------------------
1 | package com.example.kotlin
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication
4 | import org.springframework.boot.runApplication
5 | import org.springframework.context.annotation.Bean
6 | import java.util.function.Function
7 | import org.springframework.cloud.function.context.FunctionCatalog
8 | import kotlin.jvm.internal.Reflection
9 | import kotlin.jvm.javaClass
10 |
11 | @SpringBootApplication
12 | open class DemoKotlinApplication
13 |
14 | fun main(args: Array) {
15 | runApplication(*args)
16 | }
17 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/README.adoc:
--------------------------------------------------------------------------------
1 | ////
2 | DO NOT EDIT THIS FILE. IT WAS GENERATED.
3 | Manual changes to this file will be lost when it is generated again.
4 | Edit the files in the src/main/asciidoc/ directory instead.
5 | ////
6 |
7 | This project provides an adapter layer for a Spring Cloud Function application onto AWS Lambda. You can write an app with a single `@Bean` of type `Function`, `Consumer` or `Supplier` and it will be deployable in AWS if you get the JAR file laid out right. The best way to make it work is to include `spring-cloud-function-context` as a dependency, but not the higher level adapters (e.g. `spring-cloud-function-stream`).
8 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/src/main/java/example/TestFunction.java:
--------------------------------------------------------------------------------
1 | package example;
2 |
3 | import java.util.function.Function;
4 |
5 | import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
6 | import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
7 |
8 | public class TestFunction implements Function {
9 | @Override
10 | public APIGatewayProxyResponseEvent apply(APIGatewayProxyRequestEvent apiGatewayProxyRequestEvent) {
11 | return new APIGatewayProxyResponseEvent().withStatusCode(200).withBody("ok");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-http-trigger-gradle/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | .gradle
3 | build/
4 | !gradle/wrapper/gradle-wrapper.jar
5 | !**/src/main/**/build/
6 | !**/src/test/**/build/
7 |
8 | ### STS ###
9 | .apt_generated
10 | .classpath
11 | .factorypath
12 | .project
13 | .settings
14 | .springBeans
15 | .sts4-cache
16 | bin/
17 | !**/src/main/**/bin/
18 | !**/src/test/**/bin/
19 |
20 | ### IntelliJ IDEA ###
21 | .idea
22 | *.iws
23 | *.iml
24 | *.ipr
25 | out/
26 | !**/src/main/**/out/
27 | !**/src/test/**/out/
28 |
29 | ### NetBeans ###
30 | /nbproject/private/
31 | /nbbuild/
32 | /dist/
33 | /nbdist/
34 | /.nb-gradle/
35 |
36 | ### VS Code ###
37 | .vscode/
38 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/src/main/proto/MessageService.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 | option java_multiple_files = true;
3 | package org.springframework.cloud.function.grpc;
4 |
5 | message GrpcSpringMessage {
6 | bytes payload = 1;
7 | map headers = 2;
8 | }
9 |
10 | service MessagingService {
11 | rpc biStream(stream GrpcSpringMessage) returns (stream GrpcSpringMessage);
12 |
13 | rpc clientStream(stream GrpcSpringMessage) returns (GrpcSpringMessage);
14 |
15 | rpc serverStream(GrpcSpringMessage) returns (stream GrpcSpringMessage);
16 |
17 | rpc requestReply(GrpcSpringMessage) returns (GrpcSpringMessage);
18 | }
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/sample/pet-store/.aws-sam/build.toml:
--------------------------------------------------------------------------------
1 | # This file is auto generated by SAM CLI build command
2 |
3 | [function_build_definitions]
4 | [function_build_definitions.9341c1d5-9265-48ef-836e-25df000b0c59]
5 | codeuri = "/Users/ozhurakousky/Documents/dev/repo/spring-cloud-function/spring-cloud-function-adapters/spring-cloud-function-adapter-aws-web/sample/pet-store"
6 | runtime = "java11"
7 | architecture = "x86_64"
8 | handler = "org.springframework.cloud.function.adapter.aws.web.WebProxyInvoker::handleRequest"
9 | manifest_hash = ""
10 | packagetype = "Zip"
11 | functions = ["PetStoreFunction"]
12 |
13 | [layer_build_definitions]
14 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/src/main/java/oz/spring/aws/functions/FunctionRoutingConfiguration.java:
--------------------------------------------------------------------------------
1 | package oz.spring.aws.functions;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | @Configuration
10 | public class FunctionRoutingConfiguration {
11 |
12 | @Bean
13 | public Function lowercase() {
14 | return value -> value.toLowerCase(Locale.ROOT);
15 | }
16 |
17 | @Bean
18 | public Function reverse() {
19 | return value -> new StringBuilder(value).reverse().toString();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/KotlinPostProcessingFunction.kt:
--------------------------------------------------------------------------------
1 | package org.springframework.cloud.function.kotlin
2 |
3 | import org.springframework.cloud.function.context.PostProcessingFunction
4 | import org.springframework.messaging.Message
5 | import org.springframework.stereotype.Component
6 | import java.util.function.Function
7 |
8 | @Component
9 | class KotlinPostProcessingFunction : PostProcessingFunction {
10 |
11 | var invoked = false
12 |
13 | override fun apply(t: String): String {
14 | return t.uppercase();
15 | }
16 |
17 | override fun postProcess(result: Message?) {
18 | invoked = true;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: waiting-for-triage
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/src/main/proto/CloudEventService.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package io.cloudevents.v1;
4 |
5 | import "google/protobuf/any.proto";
6 | import "google/protobuf/timestamp.proto";
7 | import "CloudEvent.proto";
8 |
9 | service CloudEventService {
10 | rpc biStream(stream io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
11 |
12 | rpc clientStream(stream io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
13 |
14 | rpc serverStream(io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
15 |
16 | rpc requestReply(io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
17 | }
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/src/main/proto/CloudEventService.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package io.cloudevents.v1;
4 |
5 | import "google/protobuf/any.proto";
6 | import "google/protobuf/timestamp.proto";
7 | import "CloudEvent.proto";
8 |
9 | service CloudEventService {
10 | rpc biStream(stream io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
11 |
12 | rpc clientStream(stream io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
13 |
14 | rpc serverStream(io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
15 |
16 | rpc requestReply(io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
17 | }
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootapp-with-javax/src/main/java/function/example/UpperCaseFunction.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | import javax.mail.Address;
7 | import javax.mail.internet.AddressException;
8 | import javax.mail.internet.InternetAddress;
9 |
10 | public class UpperCaseFunction implements Function {
11 |
12 | @Override
13 | public String apply(String value) {
14 | System.out.println("Uppercasing " + value);
15 | try {
16 | Address address = new InternetAddress(value);
17 | }
18 | catch (AddressException e) {
19 | throw new IllegalStateException("Failed to create and address: ", e);
20 | }
21 | return value.toUpperCase(Locale.ROOT);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/src/main/resources/spring-azure-function-banner.txt:
--------------------------------------------------------------------------------
1 | ____ _ _ _____ _ _
2 | / ___| _ __ _ __(_)_ __ __ _ / \ _____ _ _ __ ___ | ___| _ _ __ ___| |_(_) ___ _ __ ___
3 | \___ \| '_ \| '__| | '_ \ / _` | / _ \ |_ / | | | '__/ _ \ | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __|
4 | ___) | |_) | | | | | | | (_| | / ___ \ / /| |_| | | | __/ | _|| |_| | | | | (__| |_| | (_) | | | \__ \
5 | |____/| .__/|_| |_|_| |_|\__, | /_/ \_\/___|\__,_|_| \___| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
6 | |_| |___/
7 | ${application.title} ${application.version}
8 | Powered by Spring Boot ${spring-boot.version} and Azure Functions
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/resources/spring-azure-function-banner.txt:
--------------------------------------------------------------------------------
1 | ____ _ _ _____ _ _
2 | / ___| _ __ _ __(_)_ __ __ _ / \ _____ _ _ __ ___ | ___| _ _ __ ___| |_(_) ___ _ __ ___
3 | \___ \| '_ \| '__| | '_ \ / _` | / _ \ |_ / | | | '__/ _ \ | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __|
4 | ___) | |_) | | | | | | | (_| | / ___ \ / /| |_| | | | __/ | _|| |_| | | | | (__| |_| | (_) | | | \__ \
5 | |____/| .__/|_| |_|_| |_|\__, | /_/ \_\/___|\__,_|_| \___| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
6 | |_| |___/
7 | ${application.title} ${application.version}
8 | Powered by Spring Boot ${spring-boot.version} and Azure Functions
--------------------------------------------------------------------------------
/docs/src/main/asciidoc/README.adoc:
--------------------------------------------------------------------------------
1 | :branch: master
2 |
3 | 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]
4 |
5 | [[introduction]]
6 | = Introduction
7 | :page-section-summary-toc: 1
8 |
9 |
10 | [[getting-started]]
11 | = Getting Started
12 | :page-section-summary-toc: 1
13 |
14 |
15 | [[building]]
16 | = Building
17 | :page-section-summary-toc: 1
18 |
19 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/building.adoc[]
20 |
21 | [[contributing]]
22 | = Contributing
23 | :page-section-summary-toc: 1
24 |
25 | include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/main/docs/modules/ROOT/partials/contributing.adoc[]
26 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | ### Reference Documentation
4 | For further reference, please consider the following sections:
5 |
6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.5/maven-plugin/reference/html/)
8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.5/maven-plugin/reference/html/#build-image)
9 | * [Function](https://docs.spring.io/spring-cloud-function/docs/current/reference/html/spring-cloud-function.html)
10 |
11 | ### Additional Links
12 | These additional references should also help you:
13 |
14 | * [Various sample apps using Spring Cloud Function](https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples)
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom-bean/README.adoc:
--------------------------------------------------------------------------------
1 | This sample uses the custom runtime type on AWS lambda using @Bean style configuration.
2 | However, changing configuration to functional bean registration is supported as well and shown in `function-sample-aws-custom` example.
3 |
4 | To run the app in AWS choose the "Custom Runtime" runtime type, and upload the
5 | .zip file that gets built on the command line with `mvn package` (look
6 | in `target`).
7 | There are several functions defined in the `com.example.LambdaApplication`, so identify the selected function in "Handler"
8 | You can also use function composition (e.g., `uppercase|reverse`)
9 |
10 | You can test any function in this example with any String as input, but the Lambda UI only allows valid JSON as
11 | test data, so you will have to escape the input with double quotes.
12 |
13 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom/README.adoc:
--------------------------------------------------------------------------------
1 | This sample uses the custom runtime type on AWS lambda using function bean registration style configuration.
2 | However, changing configuration to @Bean registration is supported as well and shown in `function-sample-aws-custom-bean` example.
3 |
4 | To run the app in AWS choose the "Custom Runtime" runtime type, and upload the
5 | .zip file that gets built on the command line with `mvn package` (look
6 | in `target`).
7 | There is a single function defined in the `com.example.LambdaApplication` - `uppercase` which you would typically
8 | identified as "Handler", but since it's the only one any value would do, so keeping default "hello.handler" is fine.
9 |
10 | You can test it with any String as input, but the Lambda UI only allows valid JSON as
11 | test data, so you will have to escape the input with double quotes.
12 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/mavenrepo/oz/demo/demo-stream/0.0.1-SNAPSHOT/maven-metadata-local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | oz.demo
4 | demo-stream
5 | 0.0.1-SNAPSHOT
6 |
7 |
8 | true
9 |
10 | 20200721131233
11 |
12 |
13 | jar
14 | 0.0.1-SNAPSHOT
15 | 20200721131233
16 |
17 |
18 | pom
19 | 0.0.1-SNAPSHOT
20 | 20200721131233
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-routing/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | TBD For AWS Routing
4 |
5 | ### Reference Documentation
6 | For further reference, please consider the following sections:
7 |
8 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
9 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.5/maven-plugin/reference/html/)
10 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.5/maven-plugin/reference/html/#build-image)
11 | * [Function](https://docs.spring.io/spring-cloud-function/docs/current/reference/html/spring-cloud-function.html)
12 |
13 | ### Additional Links
14 | These additional references should also help you:
15 |
16 | * [Various sample apps using Spring Cloud Function](https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples)
17 |
18 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
2 | #
3 | # You can adjust the behavior by modifying this file.
4 | # For more information, see:
5 | # https://github.com/actions/stale
6 | name: Mark stale issues and pull requests
7 |
8 | on:
9 | schedule:
10 | - cron: '42 17 * * *'
11 | workflow_dispatch:
12 | jobs:
13 | stale:
14 |
15 | runs-on: ubuntu-latest
16 | permissions:
17 | issues: write
18 | pull-requests: write
19 |
20 | steps:
21 | - uses: actions/stale@v5
22 | with:
23 | repo-token: ${{ secrets.GITHUB_TOKEN }}
24 | stale-issue-message: 'This issue has been stale for over 60 days'
25 | stale-pr-message: 'This PR has been stale for over 60 days'
26 | stale-issue-label: 'no-issue-activity'
27 | stale-pr-label: 'no-pr-activity'
28 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/getting-started.adoc:
--------------------------------------------------------------------------------
1 | = Getting Started
2 |
3 | Build from the command line (and "install" the samples):
4 |
5 | ----
6 | $ ./mvnw clean install
7 | ----
8 |
9 | (If you like to YOLO add `-DskipTests`.)
10 |
11 | Run one of the samples, e.g.
12 |
13 | ----
14 | $ java -jar spring-cloud-function-samples/function-sample/target/*.jar
15 | ----
16 |
17 | This runs the app and exposes its functions over HTTP, so you can
18 | convert a string to uppercase, like this:
19 |
20 | ----
21 | $ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d Hello
22 | HELLO
23 | ----
24 |
25 | You can convert multiple strings (a `Flux`) by separating them
26 | with new lines
27 |
28 | ----
29 | $ curl -H "Content-Type: text/plain" localhost:8080/uppercase -d 'Hello
30 | > World'
31 | HELLOWORLD
32 | ----
33 |
34 | (You can use `^Q^J` in a terminal to insert a new line in a literal
35 | string like that.)
36 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent/src/main/java/io/spring/cloudevent/Employee.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 | import java.util.Random;
6 |
7 | public class Employee {
8 |
9 | private Person person;
10 |
11 | private int id;
12 |
13 | public Employee() {
14 |
15 | }
16 |
17 | public Employee(Person person) {
18 | this.person = person;
19 | this.id = new Random().nextInt(1000);
20 | }
21 |
22 | public Person getPerson() {
23 | return person;
24 | }
25 |
26 | public void setPerson(Person person) {
27 | this.person = person;
28 | }
29 |
30 | public int getId() {
31 | return id;
32 | }
33 |
34 | public void setId(int id) {
35 | this.id = id;
36 | }
37 |
38 | public String getMessage() {
39 | return "Employee " + id + " was hired on " + new SimpleDateFormat("dd-MM-yyyy").format(new Date());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/src/main/java/io/spring/cloudevent/Employee.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 | import java.util.Random;
6 |
7 | public class Employee {
8 |
9 | private Person person;
10 |
11 | private int id;
12 |
13 | public Employee() {
14 |
15 | }
16 |
17 | public Employee(Person person) {
18 | this.person = person;
19 | this.id = new Random().nextInt(1000);
20 | }
21 |
22 | public Person getPerson() {
23 | return person;
24 | }
25 |
26 | public void setPerson(Person person) {
27 | this.person = person;
28 | }
29 |
30 | public int getId() {
31 | return id;
32 | }
33 |
34 | public void setId(int id) {
35 | this.id = id;
36 | }
37 |
38 | public String getMessage() {
39 | return "Employee " + id + " was hired on " + new SimpleDateFormat("dd-MM-yyyy").format(new Date());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-stream/src/main/java/io/spring/cloudevent/Employee.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | import java.text.SimpleDateFormat;
4 | import java.util.Date;
5 | import java.util.Random;
6 |
7 | public class Employee {
8 |
9 | private Person person;
10 |
11 | private int id;
12 |
13 | public Employee() {
14 |
15 | }
16 |
17 | public Employee(Person person) {
18 | this.person = person;
19 | this.id = new Random().nextInt(1000);
20 | }
21 |
22 | public Person getPerson() {
23 | return person;
24 | }
25 |
26 | public void setPerson(Person person) {
27 | this.person = person;
28 | }
29 |
30 | public int getId() {
31 | return id;
32 | }
33 |
34 | public void setId(int id) {
35 | this.id = id;
36 | }
37 |
38 | public String getMessage() {
39 | return "Employee " + id + " was hired on " + new SimpleDateFormat("dd-MM-yyyy").format(new Date());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/nav.adoc:
--------------------------------------------------------------------------------
1 | * xref:spring-cloud-function/introduction.adoc[]
2 | * xref:index.adoc[]
3 | ** xref:spring-cloud-function/programming-model.adoc[]
4 | ** xref:spring-cloud-function/standalone-web-applications.adoc[]
5 | ** xref:spring-cloud-function/standalone-streaming-applications.adoc[]
6 | ** xref:spring-cloud-function/deploying-a-packaged.adoc[]
7 | ** xref:functional.adoc[]
8 | ** xref:spring-cloud-function/serverless-platform-adapters.adoc[]
9 | *** xref:adapters/aws-intro.adoc[]
10 | *** xref:adapters/azure-intro.adoc[]
11 | *** xref:adapters/gcp-intro.adoc[]
12 | ** xref:spring-cloud-function/appendix.adoc[]
13 | *** https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-cloudevent[Cloud Events support]
14 | *** https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-rsocket[RSocket support]
15 | *** xref:spring-integration.adoc[Spring Integration]
--------------------------------------------------------------------------------
/docs/antora-playbook.yml:
--------------------------------------------------------------------------------
1 | antora:
2 | extensions:
3 | - require: '@springio/antora-extensions'
4 | root_component_name: 'cloud-function'
5 | site:
6 | title: Spring Cloud Function
7 | url: https://docs.spring.io/spring-cloud-function/reference/
8 | content:
9 | sources:
10 | - url: ./..
11 | branches: HEAD
12 | start_path: docs
13 | worktrees: true
14 | asciidoc:
15 | attributes:
16 | page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
17 | page-pagination: ''
18 | hide-uri-scheme: '@'
19 | tabs-sync-option: '@'
20 | chomp: 'all'
21 | extensions:
22 | - '@asciidoctor/tabs'
23 | - '@springio/asciidoctor-extensions'
24 | sourcemap: true
25 | urls:
26 | latest_version_segment: ''
27 | runtime:
28 | log:
29 | failure_level: warn
30 | format: pretty
31 | ui:
32 | bundle:
33 | url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.15/ui-bundle.zip
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | it-repo
6 |
7 | true
8 |
9 |
10 |
11 | local.central
12 | @localRepositoryUrl@
13 |
14 | true
15 |
16 |
17 | true
18 |
19 |
20 |
21 |
22 |
23 | local.central
24 | @localRepositoryUrl@
25 |
26 | true
27 |
28 |
29 | true
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/src/test/java/example/MapTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package example;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public class MapTests {
26 |
27 | @Test
28 | public void test() {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/src/test/java/example/MapTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package example;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public class MapTests {
26 |
27 | @Test
28 | public void test() {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/src/test/java/example/MapTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package example;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public class MapTests {
26 |
27 | @Test
28 | public void test() {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/docs/src/main/antora/resources/antora-resources/antora.yml:
--------------------------------------------------------------------------------
1 | version: @antora-component.version@
2 | prerelease: @antora-component.prerelease@
3 |
4 | asciidoc:
5 | attributes:
6 | attribute-missing: 'warn'
7 | chomp: 'all'
8 | project-root: @maven.multiModuleProjectDirectory@
9 | github-repo: @docs.main@
10 | github-raw: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
11 | github-code: https://github.com/spring-cloud/@docs.main@/tree/@github-tag@
12 | github-issues: https://github.com/spring-cloud/@docs.main@/issues/
13 | github-wiki: https://github.com/spring-cloud/@docs.main@/wiki
14 | spring-cloud-version: @project.version@
15 | github-tag: @github-tag@
16 | version-type: @version-type@
17 | docs-url: https://docs.spring.io/@docs.main@/docs/@project.version@
18 | raw-docs-url: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@
19 | project-version: @project.version@
20 | project-name: @docs.main@
21 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/src/test/java/example/MapTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package example;
18 |
19 | import org.junit.jupiter.api.Test;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public class MapTests {
26 |
27 | @Test
28 | public void test() {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/StringConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.web;
18 |
19 | /**
20 | * @author Dave Syer
21 | *
22 | */
23 | public interface StringConverter {
24 |
25 | Object convert(Object function, String value);
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/docs/modules/ROOT/pages/spring-cloud-function.adoc:
--------------------------------------------------------------------------------
1 | [[spring-cloud-function]]
2 | = Spring Cloud Function
3 |
4 | * xref:spring-cloud-function/introduction.adoc[]
5 | ** xref:spring-cloud-function/programming-model.adoc[]
6 | ** xref:spring-cloud-function/standalone-web-applications.adoc[]
7 | ** xref:spring-cloud-function/standalone-streaming-applications.adoc[]
8 | ** xref:spring-cloud-function/deploying-a-packaged.adoc[]
9 | ** xref:spring-cloud-function/functional-bean-definitions.adoc[]
10 | ** xref:spring-cloud-function/serverless-platform-adapters.adoc[]
11 |
12 | ** xref:spring-cloud-function/getting-started.adoc[]
13 | ** xref:spring-cloud-function/programming-model.adoc[]
14 | #** xref:spring-cloud-function/standalone-web-applications.adoc[]
15 | #** xref:spring-cloud-function/standalone-streaming-applications.adoc[]
16 | #** xref:spring-cloud-function/deploying-a-packaged.adoc[]
17 | #** xref:spring-cloud-function/functional-bean-definitions.adoc[]
18 | #** xref:spring-cloud-function/serverless-platform-adapters.adoc[]
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/FunctionRegistry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.context;
18 |
19 | /**
20 | * @author Dave Syer
21 | *
22 | */
23 | public interface FunctionRegistry extends FunctionCatalog {
24 |
25 | void register(FunctionRegistration registration);
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/src/main/java/example/FunctionConfiguration.java:
--------------------------------------------------------------------------------
1 | package example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | import org.springframework.boot.SpringApplication;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.context.annotation.Bean;
9 |
10 | @SpringBootApplication
11 | public class FunctionConfiguration {
12 |
13 | /*
14 | * You need this main method or explicit example.FunctionConfiguration
15 | * in the POM to ensure boot plug-in makes the correct entry
16 | */
17 | public static void main(String[] args) {
18 | SpringApplication.run(FunctionConfiguration.class, args);
19 | }
20 |
21 | @Bean
22 | public Function uppercase() {
23 | return value -> value.toUpperCase(Locale.ROOT);
24 | }
25 |
26 | @Bean
27 | public Function reverse() {
28 | return value -> new StringBuilder(value).reverse().toString();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-web/src/main/java/com/example/azure/web/CountryRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.azure.web;
18 |
19 | import org.springframework.data.jpa.repository.JpaRepository;
20 |
21 | /**
22 | *
23 | * @author Christian Tzolov
24 | */
25 | public interface CountryRepository extends JpaRepository {
26 | }
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pof/src/main/java/functions/Greeter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package functions;
18 |
19 | import java.util.function.Function;
20 |
21 | // @checkstyle:off
22 | public class Greeter implements Function {
23 |
24 | public String apply(String name) {
25 | return "Hello " + name;
26 | }
27 |
28 | }
29 | // @checkstyle:on
30 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/src/main/java/com/example/functions/Greeter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.functions;
18 |
19 | import java.util.function.Function;
20 |
21 | /**
22 | * @author Mark Fisher
23 | */
24 | public class Greeter implements Function {
25 |
26 | @Override
27 | public String apply(String name) {
28 | return "Hello " + name;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/simplestjarcs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | function.example
8 | simplestjarcs
9 | 1.0.0.RELEASE
10 | Showcases compoinent scanning capabilities
11 | jar
12 |
13 | simplestjarcs
14 |
15 |
16 | UTF-8
17 |
18 |
19 |
20 |
21 |
22 | org.apache.maven.plugins
23 | maven-compiler-plugin
24 |
25 | 1.8
26 | 1.8
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/src/main/java/example/FunctionConfiguration.java:
--------------------------------------------------------------------------------
1 | package example;
2 |
3 | import java.util.Locale;
4 | import java.util.function.Function;
5 |
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.context.annotation.Bean;
8 |
9 | @SpringBootApplication
10 | public class FunctionConfiguration {
11 |
12 | /*
13 | * You need this main method (empty) or explicit example.FunctionConfiguration
14 | * in the POM to ensure boot plug-in makes the correct entry
15 | */
16 | public static void main(String[] args) {
17 | // empty unless using Custom runtime at which point it should include
18 | // SpringApplication.run(FunctionConfiguration.class, args);
19 | }
20 |
21 | @Bean
22 | public Function uppercase() {
23 | return value -> {
24 | if (value.equals("exception")) {
25 | throw new RuntimeException("Intentional exception");
26 | }
27 | else {
28 | return value.toUpperCase(Locale.ROOT);
29 | }
30 | };
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-rsocket/src/main/java/io/spring/cloudevent/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | import java.util.function.Consumer;
4 |
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.cloud.function.cloudevent.CloudEventMessageBuilder;
8 | import org.springframework.cloud.stream.function.StreamBridge;
9 | import org.springframework.context.annotation.Bean;
10 |
11 | @SpringBootApplication
12 | public class DemoApplication {
13 |
14 | public static void main(String[] args) throws Exception {
15 | SpringApplication.run(DemoApplication.class, args);
16 | }
17 |
18 | @Bean
19 | public Consumer hire(StreamBridge streamBridge) {
20 | return person -> {
21 | Employee employee = new Employee(person);
22 | streamBridge.send("hire-out-0", CloudEventMessageBuilder.withData(employee)
23 | .setSource("http://spring.io/rsocket")
24 | .setId("1234567890")
25 | .build());
26 | };
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/src/main/java/com/example/functions/CharCounter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.functions;
18 |
19 | import java.util.function.Function;
20 |
21 | /**
22 | * @author Mark Fisher
23 | */
24 | public class CharCounter implements Function {
25 |
26 | @Override
27 | public Integer apply(String word) {
28 | return word.length();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/DestinationResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.web.source;
18 |
19 | import java.util.function.Supplier;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public interface DestinationResolver {
26 |
27 | String destination(Supplier> supplier, String name, Object value);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-gcp-http/README.adoc:
--------------------------------------------------------------------------------
1 | :branch: master
2 |
3 | === Google Cloud Functions Sample Application
4 |
5 | ===== Test locally
6 |
7 | Run the function:
8 |
9 | ----
10 | mvn function:run
11 | ----
12 |
13 | Invoke the HTTP function:
14 |
15 | ----
16 | curl http://localhost:8080/ -d "hello"
17 | ----
18 |
19 | ===== Deploy to GCP
20 |
21 | Package the application.
22 |
23 | ----
24 | mvn package
25 | ----
26 |
27 | You should see the fat jar in the `target/deploy` directory.
28 |
29 | Make sure that you have the https://cloud.google.com/sdk/install[Cloud SDK CLI] installed.
30 |
31 | Run the following command from the project root to deploy.
32 |
33 | ----
34 | gcloud functions deploy function-sample-gcp-http \
35 | --entry-point org.springframework.cloud.function.adapter.gcp.GcfJarLauncher \
36 | --runtime java17 \
37 | --trigger-http \
38 | --source target/deploy \
39 | --memory 512MB
40 | ----
41 |
42 | Invoke the HTTP function:
43 |
44 | ----
45 | curl https://REGION-PROJECT_ID.cloudfunctions.net/function-sample-gcp-http -d "hello"
46 | ----
47 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/assembly/native.xml:
--------------------------------------------------------------------------------
1 |
4 | native-zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | src/shell/native
12 | /
13 | true
14 | 0775
15 |
16 | bootstrap
17 |
18 |
19 |
20 | target
21 | /
22 | true
23 | 0775
24 |
25 | function-sample-aws-native
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/scf-aws-day1/src/test/java/oz/spring/aws/FunctionAwsApplicationTests.java:
--------------------------------------------------------------------------------
1 | package oz.spring.aws;
2 |
3 | import static org.assertj.core.api.Assertions.assertThat;
4 |
5 | import java.io.ByteArrayInputStream;
6 | import java.io.ByteArrayOutputStream;
7 | import java.io.InputStream;
8 | import java.nio.charset.StandardCharsets;
9 |
10 | import org.junit.jupiter.api.Test;
11 | import org.springframework.cloud.function.adapter.aws.FunctionInvoker;
12 |
13 | class FunctionAwsApplicationTests {
14 |
15 | @Test
16 | void validateFunctionInvocation() throws Exception {
17 | System.setProperty("MAIN_CLASS", FunctionAwsApplication.class.getName());
18 | FunctionInvoker invoker = new FunctionInvoker("uppercase");
19 |
20 | InputStream targetStream = new ByteArrayInputStream("\"hello aws\"".getBytes());
21 | ByteArrayOutputStream output = new ByteArrayOutputStream();
22 | invoker.handleRequest(targetStream, output, null);
23 | String result = new String(output.toByteArray(), StandardCharsets.UTF_8);
24 | assertThat(result).isEqualTo("\"HELLO AWS\"");
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/resources/META-INF/spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "hints": [],
3 | "groups": [],
4 | "properties": [
5 | {
6 | "name": "spring.cloud.function.scan.packages",
7 | "type": "java.lang.String",
8 | "description": "Triggers scanning within the specified base packages for any class that is assignable to java.util.function.Function. For each detected Function class, a bean instance will be added to the context.",
9 | "defaultValue": "functions"
10 | },
11 | {
12 | "name": "spring.cloud.function.definition",
13 | "type": "java.lang.String",
14 | "description": "Name (e.g., 'foo') or composition instruction (e.g., 'foo|bar') used to resolve default function especially for cases where there is more than one function available in catalog.",
15 | "defaultValue": ""
16 | },
17 | {
18 | "name": "spring.cloud.function.routing.enabled",
19 | "type": "java.lang.Boolean",
20 | "description": "Enables RoutingFunction which delegates incoming request to a function named via function.name header",
21 | "defaultValue": false
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootapp-multi/src/main/java/function/example/MyFn.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import reactor.core.publisher.Flux;
4 | import reactor.util.function.Tuple2;
5 | import reactor.util.function.Tuples;
6 |
7 | import java.util.Collections;
8 | import java.util.function.Function;
9 |
10 | public class MyFn implements Function, Flux>, Tuple2, Flux>> {
11 |
12 |
13 | @Override
14 | public Tuple2, Flux> apply(Tuple2, Flux> inputs) {
15 | Flux words = inputs.getT1();
16 | Flux numbers = inputs.getT2().publish().autoConnect(2);
17 |
18 |
19 | Flux avg = numbers.buffer(2, 1)
20 | .map(l -> l.stream().mapToInt(Integer::intValue).average().getAsDouble())
21 | .take(3);
22 |
23 | Flux repeated = words.zipWith(numbers)
24 | .flatMap(t -> Flux.fromIterable(Collections.nCopies(t.getT2(), t.getT1())));
25 |
26 | return Tuples.of(avg, repeated);
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/.github/workflows/deploy-docs.yml:
--------------------------------------------------------------------------------
1 | name: Deploy Docs
2 | on:
3 | push:
4 | branches-ignore: [ gh-pages ]
5 | tags: '**'
6 | repository_dispatch:
7 | types: request-build-reference # legacy
8 | #schedule:
9 | #- cron: '0 10 * * *' # Once per day at 10am UTC
10 | workflow_dispatch:
11 | permissions:
12 | actions: write
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 | # if: github.repository_owner == 'spring-cloud'
17 | steps:
18 | - name: Checkout
19 | uses: actions/checkout@v3
20 | with:
21 | ref: docs-build
22 | fetch-depth: 1
23 | - name: Dispatch (partial build)
24 | if: github.ref_type == 'branch'
25 | env:
26 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
28 | - name: Dispatch (full build)
29 | if: github.ref_type == 'tag'
30 | env:
31 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/main/java/com/example/demo/model/model/Error.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
5 | * with the License. A copy of the License is located at
6 | *
7 | * http://aws.amazon.com/apache2.0/
8 | *
9 | * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
10 | * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11 | * and limitations under the License.
12 | */
13 | package com.example.demo.model.model;
14 |
15 | public class Error {
16 | private String message;
17 |
18 | public Error(String errorMessage) {
19 | message = errorMessage;
20 | }
21 |
22 | public String getMessage() {
23 | return message;
24 | }
25 |
26 | public void setMessage(String message) {
27 | this.message = message;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/src/test/java/org/springframework/cloud/grpc/ce/SpringCloudFunctionGrpcCloudeventApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.grpc.ce;
18 |
19 | import org.springframework.boot.test.context.SpringBootTest;
20 |
21 | @SpringBootTest
22 | class SpringCloudFunctionGrpcCloudeventApplicationTests {
23 |
24 | // @Test
25 | // void contextLoads() {
26 | // }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-native/src/assembly/java.xml:
--------------------------------------------------------------------------------
1 |
4 | java-zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | target/classes
12 | /
13 |
14 |
15 | src/shell/java
16 | /
17 | true
18 | 0775
19 |
20 | bootstrap
21 |
22 |
23 |
24 |
25 |
26 | /lib
27 | false
28 | runtime
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/assembly/native.xml:
--------------------------------------------------------------------------------
1 |
4 | native-zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | src/shell/native
12 | /
13 | true
14 | 0775
15 |
16 | bootstrap
17 |
18 |
19 |
20 | target
21 | /
22 | true
23 | 0775
24 |
25 | function-sample-aws-serverless-web-native
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/RequestBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.web.source;
18 |
19 | import java.net.URI;
20 |
21 | import org.springframework.http.HttpHeaders;
22 |
23 | /**
24 | * @author Dave Syer
25 | *
26 | */
27 | public interface RequestBuilder {
28 |
29 | URI uri(String destination);
30 |
31 | HttpHeaders headers(String destination, Object value);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/src/assembly/java.xml:
--------------------------------------------------------------------------------
1 |
4 | java-zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | target/classes
12 | /
13 |
14 |
15 | src/shell/java
16 | /
17 | true
18 | 0775
19 |
20 | bootstrap
21 |
22 |
23 |
24 |
25 |
26 | /lib
27 | false
28 | runtime
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/sample/pet-store/src/assembly/bin.xml:
--------------------------------------------------------------------------------
1 |
4 | lambda-package
5 |
6 | zip
7 |
8 | false
9 |
10 |
11 |
12 | ${project.build.directory}${file.separator}lib
13 | lib
14 |
15 |
16 |
17 | ${project.build.directory}${file.separator}classes
18 |
19 | **
20 |
21 | ${file.separator}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/spring-cloud-function-deployer/src/it/bootjar-multi/src/main/java/function/example/Repeater.java:
--------------------------------------------------------------------------------
1 | package function.example;
2 |
3 | import reactor.core.publisher.Flux;
4 | import reactor.util.function.Tuple2;
5 | import reactor.util.function.Tuples;
6 |
7 | import java.util.Collections;
8 | import java.util.function.Function;
9 |
10 | public class Repeater implements Function, Flux>, Tuple2, Flux>> {
11 |
12 | @Override
13 | public Tuple2, Flux> apply(Tuple2, Flux> inputs) {
14 | Flux stringFlux = inputs.getT1();
15 | Flux integerFlux = inputs.getT2();
16 | Flux sharedIntFlux = integerFlux.publish().autoConnect(2);
17 |
18 | Flux repeated = stringFlux.zipWith(sharedIntFlux)
19 | .flatMap(t -> Flux.fromIterable(Collections.nCopies(t.getT2(), t.getT1())));
20 |
21 | Flux sum = sharedIntFlux.buffer(2, 1)
22 | .map(l -> l.stream().mapToInt(Integer::intValue).sum())
23 | ;
24 |
25 | return Tuples.of(repeated, sum);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pof/src/main/java/functions/Application.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package functions;
18 |
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.boot.autoconfigure.SpringBootApplication;
21 |
22 | // @checkstyle:off
23 | @SpringBootApplication
24 | public class Application {
25 |
26 | public static void main(String[] args) {
27 | SpringApplication.run(Application.class, args);
28 | }
29 |
30 | }
31 | // @checkstyle:on
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/test/java/org/springframework/cloud/function/context/scan/TestFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.context.scan;
18 |
19 | import java.util.Locale;
20 | import java.util.function.Function;
21 |
22 | /**
23 | * @author Dave Syer
24 | *
25 | */
26 | public class TestFunction implements Function {
27 |
28 | @Override
29 | public String apply(String t) {
30 | return t.toUpperCase(Locale.ROOT);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample/src/main/java/com/example/functions/Exclaimer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.functions;
18 |
19 | import java.util.function.Function;
20 |
21 | import reactor.core.publisher.Flux;
22 |
23 | /**
24 | * @author Mark Fisher
25 | */
26 | public class Exclaimer implements Function, Flux> {
27 |
28 | @Override
29 | public Flux apply(Flux words) {
30 | return words.map(word -> word + "!!!");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionCatalogEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.context.catalog;
18 |
19 | import org.springframework.context.ApplicationEvent;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | @SuppressWarnings("serial")
26 | public class FunctionCatalogEvent extends ApplicationEvent {
27 |
28 | public FunctionCatalogEvent(Object source) {
29 | super(source);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.springframework.cloud.function.aws-lambda.packaging
8 | spring-cloud-function-aws-gradle-parent
9 | pom
10 | 1.0.0
11 |
12 | spring-cloud-function-aws-gradle-parent
13 | AWS Lambda Adapter for Spring Cloud Function
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | spring-cloud-function-aws-packaging-gradle-plugin
23 | org.springframework.cloud.function.aws-lambda.packaging.gradle.plugin
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
19 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-kotlin-web/README.adoc:
--------------------------------------------------------------------------------
1 | ## Examples of Kotlin support in Spring Cloud Function
2 |
3 | ### Introduction
4 | This example provides a configuration with a single Kotlin function
5 |
6 | [source, kotlin]
7 | ----
8 | @Configuration
9 | class DemoKotlinConfiguration {
10 | @Bean
11 | fun uppercase(): (String) -> String {
12 | return { it.toUpperCase() }
13 | }
14 | }
15 | ----
16 |
17 | It also adds web support
18 |
19 | [source, xml]
20 | ----
21 |
22 | org.springframework.cloud
23 | spring-cloud-function-kotlin
24 | ${spring-cloud-function.version}
25 |
26 |
27 | org.springframework.cloud
28 | spring-cloud-function-web
29 | ${spring-cloud-function.version}
30 |
31 | ----
32 |
33 | Once you start the application, simply issue GET request either thru browser or curl:
34 |
35 | [source, text]
36 | ----
37 | curl http://localhost:8080/uppercase/hello
38 | ----
39 |
40 | you should see the output
41 |
42 | [source, text]
43 | ----
44 | HELLO
45 | ----
46 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/sample/pet-store/src/main/java/oz/spring/petstore/model/Error.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package oz.spring.petstore.model;
18 |
19 | public class Error {
20 | private String message;
21 |
22 | public Error(String errorMessage) {
23 | message = errorMessage;
24 | }
25 |
26 | public String getMessage() {
27 | return message;
28 | }
29 |
30 | public void setMessage(String message) {
31 | this.message = message;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-adapter-azure/README.adoc:
--------------------------------------------------------------------------------
1 | ////
2 | DO NOT EDIT THIS FILE. IT WAS GENERATED.
3 | Manual changes to this file will be lost when it is generated again.
4 | Edit the files in the src/main/asciidoc/ directory instead.
5 | ////
6 |
7 | This project provides an adapter layer for a Spring Cloud Function application onto Azure.
8 | You can write an app with a single `@Bean` of type `Function` and it will be deployable in Azure if you get the JAR file laid out right.
9 |
10 | == Sample Functions
11 |
12 | - ../../spring-cloud-function-samples/function-sample-azure-http-trigger[Azure HTTP Trigger (Maven)]
13 | - ../../spring-cloud-function-samples/function-sample-azure-http-trigger-gradle[Azure HTTP Trigger (Gradle)]
14 | - ../../spring-cloud-function-samples/function-sample-azure-blob-trigger[Azure Blob Trigger (Maven)]
15 | - ../../spring-cloud-function-samples/function-sample-azure-timer-trigger[Azure Timer Trigger (Maven)]
16 | - ../../spring-cloud-function-samples/function-sample-azure-kafka-trigger[Azure Kafka Trigger & Output Binding (Maven)]
17 | - ../../spring-cloud-function-samples/function-sample-azure/[(Legacy - FunctionInvoker) Azure HTTP Trigger (Maven)]
18 |
--------------------------------------------------------------------------------
/spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/Person.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.kotlin
18 |
19 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration
20 | import org.springframework.context.annotation.Bean
21 | import org.springframework.context.annotation.Configuration
22 | import java.util.function.Function
23 |
24 | /**
25 | * @author Oleg Zhurakousky
26 | *
27 | */
28 | class Person {
29 |
30 | var name:String? = null;
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-function-core/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | spring-cloud-function-core
8 | jar
9 | Spring Cloud Function Core
10 | Spring Cloud Function Core
11 |
12 |
13 | org.springframework.cloud
14 | spring-cloud-function-parent
15 | 5.0.1-SNAPSHOT
16 |
17 |
18 |
19 |
20 | io.projectreactor
21 | reactor-core
22 |
23 |
24 | org.springframework
25 | spring-core
26 |
27 |
28 | org.springframework.boot
29 | spring-boot-starter-test
30 | test
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/src/test/java/org/springframework/cloud/function/test/app/FreemarkerController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.test.app;
18 |
19 | import org.springframework.stereotype.Controller;
20 | import org.springframework.web.bind.annotation.GetMapping;
21 |
22 | @Controller
23 | public class FreemarkerController {
24 |
25 | public FreemarkerController() {
26 | }
27 |
28 | @GetMapping("/index")
29 | public String something2() {
30 | return "index";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | spring-cloud-function-adapter-parent
8 | pom
9 |
10 |
11 | org.springframework.cloud
12 | spring-cloud-function-parent
13 | 5.0.1-SNAPSHOT
14 |
15 |
16 | spring-cloud-function-adapter-parent
17 |
18 |
19 | spring-cloud-function-adapter-aws
20 |
21 | spring-cloud-function-adapter-azure
22 | spring-cloud-function-adapter-gcp
23 | spring-cloud-function-grpc
24 | spring-cloud-function-grpc-cloudevent-ext
25 | spring-cloud-function-serverless-web
26 | spring-cloud-function-adapter-azure-web
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/SimpleDestinationResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.web.source;
18 |
19 | import java.util.function.Supplier;
20 |
21 | /**
22 | * @author Dave Syer
23 | *
24 | */
25 | public class SimpleDestinationResolver implements DestinationResolver {
26 |
27 | @Override
28 | public String destination(Supplier> supplier, String name, Object value) {
29 | return name.contains("|") ? name.substring(0, name.indexOf("|")).trim() : name;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/utils/SocketUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.utils;
18 |
19 | import java.net.ServerSocket;
20 |
21 | public final class SocketUtils {
22 |
23 | private SocketUtils() {
24 | }
25 |
26 | public static int findAvailableTcpPort() {
27 | try {
28 | ServerSocket s = new ServerSocket(0);
29 | int port = s.getLocalPort();
30 | s.close();
31 | return port;
32 | }
33 | catch (Exception e) {
34 | // ignore
35 | }
36 | return 0;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom/src/assembly/zip.xml:
--------------------------------------------------------------------------------
1 |
4 | zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | target/classes
12 | /
13 | true
14 |
15 | bootstrap
16 |
17 |
18 |
19 | target/classes
20 | /
21 | true
22 | 0775
23 |
24 | bootstrap
25 |
26 |
27 |
28 |
29 |
30 | /lib
31 | false
32 | runtime
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-custom-bean/src/assembly/zip.xml:
--------------------------------------------------------------------------------
1 |
4 | zip
5 |
6 | zip
7 |
8 |
9 |
10 |
11 | target/classes
12 | /
13 | true
14 |
15 | bootstrap
16 |
17 |
18 |
19 | target/classes
20 | /
21 | true
22 | 0775
23 |
24 | bootstrap
25 |
26 |
27 |
28 |
29 |
30 | /lib
31 | false
32 | runtime
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-starter-function-web/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.springframework.cloud
8 | spring-cloud-function-parent
9 | 5.0.1-SNAPSHOT
10 | ..
11 |
12 | spring-cloud-starter-function-web
13 | spring-cloud-starter-starter-function-web
14 | Spring Cloud Starter
15 | https://projects.spring.io/spring-cloud
16 |
17 | Pivotal Software, Inc.
18 | https://www.spring.io
19 |
20 |
21 |
22 | org.springframework.cloud
23 | spring-cloud-function-web
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-web
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/sample/pet-store/template.yml:
--------------------------------------------------------------------------------
1 | AWSTemplateFormatVersion: '2010-09-09'
2 | Transform: AWS::Serverless-2016-10-31
3 | Description: Example Pet Store API written with spring-cloud-function web-proxy support
4 |
5 | Globals:
6 | Api:
7 | # API Gateway regional endpoints
8 | EndpointConfiguration: REGIONAL
9 |
10 | Resources:
11 | PetStoreFunction:
12 | Type: AWS::Serverless::Function
13 | Properties:
14 | Handler: org.springframework.cloud.function.adapter.aws.web.WebProxyInvoker::handleRequest
15 | Runtime: java11
16 | CodeUri: .
17 | MemorySize: 512
18 | Policies: AWSLambdaBasicExecutionRole
19 | Timeout: 30
20 | Environment:
21 | Variables:
22 | MAIN_CLASS: oz.spring.petstore.PetStoreSpringAppConfig
23 | Events:
24 | HttpApiEvent:
25 | Type: HttpApi
26 | Properties:
27 | TimeoutInMillis: 20000
28 | PayloadFormatVersion: '1.0'
29 |
30 | Outputs:
31 | SpringPetStoreApi:
32 | Description: URL for application
33 | Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/pets'
34 | Export:
35 | Name: PetStoreLambda
36 |
37 |
38 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-gcp-background/src/main/java/com/example/BackgroundFunctionMain.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import java.nio.charset.StandardCharsets;
4 | import java.util.Base64;
5 | import java.util.function.Consumer;
6 |
7 | import org.springframework.boot.SpringApplication;
8 | import org.springframework.boot.autoconfigure.SpringBootApplication;
9 | import org.springframework.context.annotation.Bean;
10 |
11 | @SpringBootApplication
12 | public class BackgroundFunctionMain {
13 |
14 | public static void main(String[] args) {
15 | SpringApplication.run(BackgroundFunctionMain.class, args);
16 | }
17 |
18 | /**
19 | * The background function which triggers on an event from Pub/Sub and consumes the Pub/Sub
20 | * event message.
21 | */
22 | @Bean
23 | public Consumer pubSubFunction() {
24 | return message -> {
25 | // The PubSubMessage data field arrives as a base-64 encoded string and must be decoded.
26 | // See: https://cloud.google.com/functions/docs/calling/pubsub#event_structure
27 | String decodedMessage = new String(Base64.getDecoder().decode(message.getData()), StandardCharsets.UTF_8);
28 | System.out.println("Received Pub/Sub message with data: " + decodedMessage);
29 | };
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-serverless-web/README.md:
--------------------------------------------------------------------------------
1 | #### Introduction
2 |
3 | This module represents a concept of a light weight AWS forwarding proxy which deploys and interacts with existing
4 | Spring Boot web application deployed as AWS Lambda.
5 |
6 |
7 | A sample is provided in [sample](https://github.com/spring-cloud/spring-cloud-function/tree/serverless-web/spring-cloud-function-adapters/spring-cloud-function-adapter-aws-web/sample/pet-store) directory. It contain README and SAM template file to simplify the deployment. This module is identified as the only additional dependnecy to the existing web-app.
8 |
9 | _NOTE: Although this module is AWS specific, this dependency is protocol only (not binary), therefore there is no AWS dependnecies._
10 |
11 | The aformentioned proxy is identified as AWS Lambda [handler](https://github.com/spring-cloud/spring-cloud-function/blob/serverless-web/spring-cloud-function-adapters/spring-cloud-function-adapter-aws-web/sample/pet-store/template.yml#L14)
12 |
13 | The main Spring Boot configuration file is identified as [MAIN_CLASS](https://github.com/spring-cloud/spring-cloud-function/blob/serverless-web/spring-cloud-function-adapters/spring-cloud-function-adapter-aws-web/sample/pet-store/template.yml#L22)
14 |
15 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-spring-integration/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | springBootVersion = '2.1.2.RELEASE'
4 | }
5 | repositories {
6 | mavenCentral()
7 | maven { url 'https://repo.spring.io/libs-milestone' }
8 | }
9 | dependencies {
10 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
11 | }
12 | }
13 |
14 | apply plugin: 'java'
15 | apply plugin: 'eclipse'
16 | apply plugin: 'org.springframework.boot'
17 | apply plugin: 'io.spring.dependency-management'
18 |
19 | group = 'io.spring.sample'
20 | version = '0.0.1-SNAPSHOT'
21 | sourceCompatibility = 1.8
22 |
23 | repositories {
24 | mavenCentral()
25 | maven { url "https://repo.spring.io/milestone" }
26 | }
27 |
28 |
29 | ext {
30 | springCloudFunctionVersion = '2.1.0.BUILD-SNAPSHOT'
31 | }
32 |
33 | dependencies {
34 | implementation('org.springframework.boot:spring-boot-starter-integration')
35 | implementation('org.springframework.cloud:spring-cloud-starter-function-webflux')
36 | testImplementation('org.springframework.boot:spring-boot-starter-test')
37 | }
38 |
39 | dependencyManagement {
40 | imports {
41 | mavenBom "org.springframework.cloud:spring-cloud-function-dependencies:${springCloudFunctionVersion}"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootCategory=DEBUG, LAMBDA
2 | PID=????
3 | LOG_LEVEL_PATTERN=%5p
4 | LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - ${PID} ${LOG_LEVEL_PATTERN} [%t] --- %c{1}: %m%n
5 | # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
6 | log4j.appender.LAMBDA=com.amazonaws.services.lambda.runtime.log4j.LambdaAppender
7 | log4j.appender.LAMBDA.layout=org.apache.log4j.PatternLayout
8 | log4j.appender.LAMBDA.layout.conversionPattern=${LOG_PATTERN}
9 | log4j.category.org.apache.catalina.startup.DigesterFactory=ERROR
10 | log4j.category.org.apache.catalina.util.LifecycleBase=ERROR
11 | log4j.category.org.apache.coyote.http11.Http11NioProtocol=WARN
12 | log4j.category.org.apache.sshd.common.util.SecurityUtils
13 | log4j.category.org.apache.tomcat.util.net.NioSelectorPool=WARN
14 | log4j.category.org.crsh.plugin=WARN
15 | log4j.category.org.crsh.ssh=WARN
16 | log4j.category.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
17 | log4j.category.org.hibernate.validator.internal.util.Version=WARN
18 | log4j.category.org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration=WARN
19 | log4j.category.org.springframework.boot.actuate.endpoint.jmx=WARN
20 | log4j.category.org.thymeleaf=WARN
21 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-routing/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootCategory=DEBUG, LAMBDA
2 | PID=????
3 | LOG_LEVEL_PATTERN=%5p
4 | LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - ${PID} ${LOG_LEVEL_PATTERN} [%t] --- %c{1}: %m%n
5 | # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
6 | log4j.appender.LAMBDA=com.amazonaws.services.lambda.runtime.log4j.LambdaAppender
7 | log4j.appender.LAMBDA.layout=org.apache.log4j.PatternLayout
8 | log4j.appender.LAMBDA.layout.conversionPattern=${LOG_PATTERN}
9 | log4j.category.org.apache.catalina.startup.DigesterFactory=ERROR
10 | log4j.category.org.apache.catalina.util.LifecycleBase=ERROR
11 | log4j.category.org.apache.coyote.http11.Http11NioProtocol=WARN
12 | log4j.category.org.apache.sshd.common.util.SecurityUtils
13 | log4j.category.org.apache.tomcat.util.net.NioSelectorPool=WARN
14 | log4j.category.org.crsh.plugin=WARN
15 | log4j.category.org.crsh.ssh=WARN
16 | log4j.category.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
17 | log4j.category.org.hibernate.validator.internal.util.Version=WARN
18 | log4j.category.org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration=WARN
19 | log4j.category.org.springframework.boot.actuate.endpoint.jmx=WARN
20 | log4j.category.org.thymeleaf=WARN
21 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-functional-sample-aws/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootCategory=DEBUG, LAMBDA
2 | PID=????
3 | LOG_LEVEL_PATTERN=%5p
4 | LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - ${PID} ${LOG_LEVEL_PATTERN} [%t] --- %c{1}: %m%n
5 | # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
6 | log4j.appender.LAMBDA=com.amazonaws.services.lambda.runtime.log4j.LambdaAppender
7 | log4j.appender.LAMBDA.layout=org.apache.log4j.PatternLayout
8 | log4j.appender.LAMBDA.layout.conversionPattern=${LOG_PATTERN}
9 | log4j.category.org.apache.catalina.startup.DigesterFactory=ERROR
10 | log4j.category.org.apache.catalina.util.LifecycleBase=ERROR
11 | log4j.category.org.apache.coyote.http11.Http11NioProtocol=WARN
12 | log4j.category.org.apache.sshd.common.util.SecurityUtils
13 | log4j.category.org.apache.tomcat.util.net.NioSelectorPool=WARN
14 | log4j.category.org.crsh.plugin=WARN
15 | log4j.category.org.crsh.ssh=WARN
16 | log4j.category.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
17 | log4j.category.org.hibernate.validator.internal.util.Version=WARN
18 | log4j.category.org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration=WARN
19 | log4j.category.org.springframework.boot.actuate.endpoint.jmx=WARN
20 | log4j.category.org.thymeleaf=WARN
21 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws-serverless-web-native/README.md:
--------------------------------------------------------------------------------
1 | In this sample, you'll build a native GraalVM image for running web workloads in AWS Lambda.
2 |
3 |
4 | ## To build the sample on macOS (Apple silicon arm64)
5 |
6 | You first need to build the function, then you will deploy it to AWS Lambda.
7 |
8 | ### Step 1 - Build the native image
9 |
10 | Before starting the build, you must clone or download the code in **function-sample-aws-native**.
11 |
12 | 1. Change into the project directory: `spring-cloud-function-samples/function-sample-aws-native`
13 | 2. Run the following to build a Docker container image which will be used to create the Lambda function zip file.
14 | ```
15 | docker build -t "al2-graalvm21:native-function" .
16 | ```
17 | 3. Start the container
18 | ```
19 | docker run -dit -v `pwd`:`pwd` -w `pwd` -v ~/.m2:/root/.m2 al2-graalvm21:native-function
20 | ```
21 | 4. In Docker, open the image terminal.
22 |
23 | > Your working directory should default to the project root. Verify by running `ls` to view the files.
24 |
25 | 6. From inside the container, build the Lambda function:
26 | ```
27 | ./mvnw clean -Pnative native:compile -DskipTests
28 | ```
29 |
30 | After the build finishes, you need to deploy the function.
31 |
32 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-aws-gradle-parent/org.springframework.cloud.function.aws-lambda.packaging.gradle.plugin/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.springframework.cloud.function.aws-lambda.packaging.gradle.plugin
8 | pom
9 | Marker Artifact for Gradle Plugin to assist with packaging Spring Cloud Function based AWS Lambda application
10 |
11 | org.springframework.cloud.function.aws-lambda.packaging
12 | spring-cloud-function-aws-gradle-parent
13 | 5.0.1-SNAPSHOT
14 |
15 |
16 | ${basedir}/../..
17 |
18 |
19 |
20 | org.springframework.cloud.function.aws-lambda.packaging
21 | spring-cloud-function-aws-packaging-gradle-plugin
22 | 1.0.0
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-cloud-function-core/src/main/java/org/springframework/cloud/function/core/FunctionInvocationHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | package org.springframework.cloud.function.core;
19 |
20 |
21 | /**
22 | *
23 | * @author Oleg Zhurakousky
24 | * @author John Blum
25 | * @since 3.1
26 | *
27 | */
28 | public interface FunctionInvocationHelper {
29 |
30 | default boolean isRetainOutputAsMessage(I input) {
31 | return true;
32 | }
33 |
34 | default I preProcessInput(I input, Object inputConverter) {
35 | return input;
36 | }
37 |
38 | default Object postProcessResult(Object result, I input) {
39 | return result;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-functional-aws-routing/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootCategory=DEBUG, LAMBDA
2 | PID=????
3 | LOG_LEVEL_PATTERN=%5p
4 | LOG_PATTERN=[%d{yyyy-MM-dd HH:mm:ss.SSS}] boot%X{context} - ${PID} ${LOG_LEVEL_PATTERN} [%t] --- %c{1}: %m%n
5 | # CONSOLE is set to be a ConsoleAppender using a PatternLayout.
6 | log4j.appender.LAMBDA=com.amazonaws.services.lambda.runtime.log4j.LambdaAppender
7 | log4j.appender.LAMBDA.layout=org.apache.log4j.PatternLayout
8 | log4j.appender.LAMBDA.layout.conversionPattern=${LOG_PATTERN}
9 | log4j.category.org.apache.catalina.startup.DigesterFactory=ERROR
10 | log4j.category.org.apache.catalina.util.LifecycleBase=ERROR
11 | log4j.category.org.apache.coyote.http11.Http11NioProtocol=WARN
12 | log4j.category.org.apache.sshd.common.util.SecurityUtils
13 | log4j.category.org.apache.tomcat.util.net.NioSelectorPool=WARN
14 | log4j.category.org.crsh.plugin=WARN
15 | log4j.category.org.crsh.ssh=WARN
16 | log4j.category.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
17 | log4j.category.org.hibernate.validator.internal.util.Version=WARN
18 | log4j.category.org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration=WARN
19 | log4j.category.org.springframework.boot.actuate.endpoint.jmx=WARN
20 | log4j.category.org.thymeleaf=WARN
21 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-aws/template.yml:
--------------------------------------------------------------------------------
1 | AWSTemplateFormatVersion: '2010-09-09'
2 | Transform: AWS::Serverless-2016-10-31
3 | Description: Example function as lambda deployment
4 |
5 | Globals:
6 | Api:
7 | # API Gateway regional endpoints
8 | EndpointConfiguration: REGIONAL
9 |
10 | Resources:
11 | UppercaseFunction:
12 | Type: AWS::Serverless::Function
13 | Properties:
14 | # AutoPublishAlias: bcn
15 | FunctionName: uppercase
16 | Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
17 | Runtime: java17
18 | SnapStart:
19 | ApplyOn: PublishedVersions
20 | CodeUri: .
21 | MemorySize: 1024
22 | Policies: AWSLambdaBasicExecutionRole
23 | Timeout: 30
24 | Environment:
25 | Variables:
26 | MAIN_CLASS: example.FunctionConfiguration
27 | Events:
28 | HttpApiEvent:
29 | Type: HttpApi
30 | Properties:
31 | TimeoutInMillis: 20000
32 | PayloadFormatVersion: '1.0'
33 |
34 | Outputs:
35 | UppercaseFunctionApi:
36 | Description: URL for application
37 | Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/uppercase'
38 | Export:
39 | Name: UppercaseAPI
40 |
41 |
42 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc/src/main/java/org/springframework/cloud/function/grpc/GrpcMessageConverter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.grpc;
18 |
19 | import com.google.protobuf.GeneratedMessageV3;
20 |
21 | import org.springframework.messaging.Message;
22 |
23 | /**
24 | *
25 | * @author Oleg Zhurakousky
26 | *
27 | * @param instance of {@link GeneratedMessageV3}
28 | */
29 | public interface GrpcMessageConverter {
30 |
31 | Message toSpringMessage(T grpcMessage);
32 |
33 | T fromSpringMessage(Message springMessage, Class grpcClass);
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-pojo/src/main/java/com/example/LowercaseConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example;
18 |
19 | import java.util.function.Function;
20 |
21 | import reactor.core.publisher.Flux;
22 |
23 | import org.springframework.context.annotation.Bean;
24 | import org.springframework.context.annotation.Configuration;
25 |
26 | /**
27 | * @author Dave Syer
28 | *
29 | */
30 | @Configuration(proxyBeanMethods = false)
31 | public class LowercaseConfiguration {
32 |
33 | @Bean
34 | public Function, Flux> lowercase() {
35 | return flux -> flux.log().map(value -> new Bar(value.lowercase()));
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/docs/src/main/ruby/generate_readme.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | base_dir = File.join(File.dirname(__FILE__),'../../..')
4 | src_dir = File.join(base_dir, "/src/main/asciidoc")
5 | require 'asciidoctor'
6 | require 'optparse'
7 |
8 | options = {}
9 | file = "#{src_dir}/README.adoc"
10 |
11 | OptionParser.new do |o|
12 | o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' }
13 | o.on('-h', '--help') { puts o; exit }
14 | o.parse!
15 | end
16 |
17 | file = ARGV[0] if ARGV.length>0
18 |
19 | # Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb
20 | doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes]
21 | header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a
22 | header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k }
23 | attrs = doc.attributes
24 | attrs['allow-uri-read'] = true
25 | puts attrs
26 |
27 | out = "// Do not edit this file (e.g. go instead to src/main/asciidoc)\n\n"
28 | doc = Asciidoctor.load_file file, safe: :unsafe, parse: false, attributes: attrs
29 | out << doc.reader.read
30 |
31 | unless options[:to_file]
32 | puts out
33 | else
34 | File.open(options[:to_file],'w+') do |file|
35 | file.write(out)
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-cloudevent-sdk/src/main/java/io/spring/cloudevent/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package io.spring.cloudevent;
2 |
3 | import java.net.URI;
4 | import java.util.UUID;
5 | import java.util.function.Function;
6 |
7 | import org.springframework.boot.SpringApplication;
8 | import org.springframework.boot.autoconfigure.SpringBootApplication;
9 | import org.springframework.context.annotation.Bean;
10 |
11 | import io.cloudevents.CloudEvent;
12 | import io.cloudevents.core.builder.CloudEventBuilder;
13 | import io.cloudevents.spring.messaging.CloudEventMessageConverter;
14 |
15 | @SpringBootApplication
16 | public class DemoApplication {
17 |
18 | public static void main(String[] args) throws Exception {
19 | SpringApplication.run(DemoApplication.class, args);
20 | }
21 |
22 | @Bean
23 | public Function echo() {
24 | return ce -> {
25 | System.out.println("Received: " + ce);
26 | return CloudEventBuilder.from(ce)
27 | .withId(UUID.randomUUID().toString())
28 | .withSource(URI.create("https://spring.io/foos"))
29 | .withType("io.spring.event.Foo")
30 | .withData(ce.getData().toBytes())
31 | .build();
32 | };
33 | }
34 |
35 | @Bean
36 | public CloudEventMessageConverter cloudEventMessageConverter() {
37 | return new CloudEventMessageConverter();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-azure-kafka-trigger/src/main/java/example/entity/KafkaHeaders.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package example.entity;
17 |
18 | import com.fasterxml.jackson.annotation.JsonProperty;
19 |
20 | public class KafkaHeaders {
21 | @JsonProperty("Key")
22 | private String key;
23 | @JsonProperty("Value")
24 | private String value;
25 |
26 | public String getKey() {
27 | return key;
28 | }
29 |
30 | public void setKey(String key) {
31 | this.key = key;
32 | }
33 |
34 | public String getValue() {
35 | return value;
36 | }
37 |
38 | public void setValue(String value) {
39 | this.value = value;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/spring-cloud-function-samples/function-sample-grpc-cloudevent/src/main/proto/CloudEvent.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package io.cloudevents.v1;
4 |
5 | import "google/protobuf/any.proto";
6 | import "google/protobuf/timestamp.proto";
7 |
8 | option go_package = "cloudevents.io/genproto/v1";
9 | option java_package = "io.cloudevents.v1.proto";
10 | option java_multiple_files = true;
11 |
12 | message CloudEvent {
13 |
14 | // -- CloudEvent Context Attributes
15 |
16 | // Required Attributes
17 | string id = 1;
18 | string source = 2; // URI-reference
19 | string spec_version = 3;
20 | string type = 4;
21 |
22 | // Optional & Extension Attributes
23 | map attributes = 5;
24 |
25 | // -- CloudEvent Data (Bytes, Text, or Proto)
26 | oneof data {
27 | bytes binary_data = 6;
28 | string text_data = 7;
29 | google.protobuf.Any proto_data = 8;
30 | }
31 |
32 | /**
33 | * The CloudEvent specification defines
34 | * seven attribute value types...
35 | */
36 |
37 | message CloudEventAttributeValue {
38 |
39 | oneof attr {
40 | bool ce_boolean = 1;
41 | int32 ce_integer = 2;
42 | string ce_string = 3;
43 | bytes ce_bytes = 4;
44 | string ce_uri = 5;
45 | string ce_uri_ref = 6;
46 | google.protobuf.Timestamp ce_timestamp = 7;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/RestApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.web;
18 |
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.boot.SpringBootConfiguration;
21 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
22 |
23 | /**
24 | * @author Mark Fisher
25 | */
26 | // @checkstyle:off
27 | @SpringBootConfiguration(proxyBeanMethods = false)
28 | @EnableAutoConfiguration
29 | public class RestApplication {
30 |
31 | public static void main(String[] args) {
32 | SpringApplication.run(RestApplication.class, args);
33 | }
34 |
35 | }
36 | // @checkstyle:on
37 |
--------------------------------------------------------------------------------
/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext/src/main/proto/CloudEvent.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package io.cloudevents.v1;
4 |
5 | import "google/protobuf/any.proto";
6 | import "google/protobuf/timestamp.proto";
7 |
8 | option go_package = "cloudevents.io/genproto/v1";
9 | option java_package = "io.cloudevents.v1.proto";
10 | option java_multiple_files = true;
11 |
12 | message CloudEvent {
13 |
14 | // -- CloudEvent Context Attributes
15 |
16 | // Required Attributes
17 | string id = 1;
18 | string source = 2; // URI-reference
19 | string spec_version = 3;
20 | string type = 4;
21 |
22 | // Optional & Extension Attributes
23 | map attributes = 5;
24 |
25 | // -- CloudEvent Data (Bytes, Text, or Proto)
26 | oneof data {
27 | bytes binary_data = 6;
28 | string text_data = 7;
29 | google.protobuf.Any proto_data = 8;
30 | }
31 |
32 | /**
33 | * The CloudEvent specification defines
34 | * seven attribute value types...
35 | */
36 |
37 | message CloudEventAttributeValue {
38 |
39 | oneof attr {
40 | bool ce_boolean = 1;
41 | int32 ce_integer = 2;
42 | string ce_string = 3;
43 | bytes ce_bytes = 4;
44 | string ce_uri = 5;
45 | string ce_uri_ref = 6;
46 | google.protobuf.Timestamp ce_timestamp = 7;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/spring-cloud-function-context/src/test/java/org/springframework/cloud/function/inject/FooConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012-present the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.springframework.cloud.function.inject;
18 |
19 | import java.util.Locale;
20 | import java.util.function.Function;
21 |
22 | import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfigurationTests.Foo;
23 | import org.springframework.context.annotation.Bean;
24 | import org.springframework.context.annotation.Configuration;
25 |
26 | @Configuration
27 | public class FooConfiguration {
28 |
29 | @Bean
30 | public Function foos(String foo) {
31 | return value -> new Foo(foo + ": " + value.toUpperCase(Locale.ROOT));
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------