You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/adapters/aws-intro.adoc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ appropriate AWS deployable JAR file. (You can read more details about JAR layout
44
44
45
45
Then you have to upload the JAR file (via AWS dashboard or AWS CLI) to AWS.
46
46
47
-
When ask about _handler_ you specify `org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest` which is a generic request handler.
47
+
When asked about _handler_ you specify `org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest` which is a generic request handler.
@@ -62,7 +62,7 @@ to use. The next section will explain you how you can accomplish just that.
62
62
While AWS Lambda allows you to implement various `RequestHandlers`, with Spring Cloud Function you don't need to implement any, and instead use the provided
63
63
`org.springframework.cloud.function.adapter.aws.FunctionInvoker` which is the implementation of AWS's `RequestStreamHandler`.
64
64
User doesn't need to do anything other then specify it as 'handler' on AWS dashboard when deploying function.
65
-
It will handle most of the case including Kinesis, streaming etc. .
65
+
It will handle most of the cases including Kinesis, streaming etc.
66
66
67
67
68
68
If your app has more than one `@Bean` of type `Function` etc. then you can choose the one to use by configuring `spring.cloud.function.definition`
The `com.example.LambdaApplication` represents your application which contains function beans.
135
135
136
-
Set the handler name in AWS to the name of your function. You can use function composition here as well (e.g., `uppecrase|reverse`).
136
+
Set the handler name in AWS to the name of your function. You can use function composition here as well (e.g., `uppercase|reverse`).
137
137
That is pretty much all. Once you upload your zip/jar to AWS your function will run in custom runtime.
138
138
We provide a https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws-custom-new[sample project]
139
-
where you can also see how to configure yoru POM to properly generate the zip file.
139
+
where you can also see how to configure your POM to properly generate the zip file.
140
140
141
141
The functional bean definition style works for custom runtimes as well, and is
142
142
faster than the `@Bean` style. A custom runtime can start up much quicker even than a functional bean implementation
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/adapters/aws.adoc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ appropriate AWS deployable JAR file. (You can read more details about JAR layout
47
47
48
48
Then you have to upload the JAR file (via AWS dashboard or AWS CLI) to AWS.
49
49
50
-
When ask about _handler_ you specify `org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest` which is a generic request handler.
50
+
When asked about _handler_ you specify `org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest` which is a generic request handler.
The `com.example.LambdaApplication` represents your application which contains function beans.
145
145
146
-
Set the handler name in AWS to the name of your function. You can use function composition here as well (e.g., `uppecrase|reverse`).
146
+
Set the handler name in AWS to the name of your function. You can use function composition here as well (e.g., `uppercase|reverse`).
147
147
That is pretty much all. Once you upload your zip/jar to AWS your function will run in custom runtime.
148
148
We provide a https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples/function-sample-aws-custom-new[sample project]
149
-
where you can also see how to configure yoru POM to properly generate the zip file.
149
+
where you can also see how to configure your POM to properly generate the zip file.
150
150
151
151
The functional bean definition style works for custom runtimes as well, and is
152
152
faster than the `@Bean` style. A custom runtime can start up much quicker even than a functional bean implementation
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,13 +55,13 @@ Function uppercase = catalog.lookup(“uppercase”);
55
55
----
56
56
57
57
Important to understand that given that `uppercase` is a bean, you can certainly get it form the `ApplicationContext` directly, but all you will get is just your bean as you declared it without any extra features provided by SCF. When you do lookup of a function via `FunctionCatalog`, the instance you will receive is wrapped (instrumented) with additional features (i.e., type conversion, composition etc.) described in this manual. Also, it is important to understand that a typical user does not use Spring Cloud Function directly. Instead a typical user implements Java `Function/Supplier/Consumer` with the idea of using it in different execution contexts without additional work. For example the same java function could be represented as _REST endpoint_ or _Streaming message handler_ or _AWS Lambda_ and more via Spring Cloud Function provided
58
-
adapters as well as other frameworks using Spring Cloud Function as the core programming model (e.g., https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream])
58
+
adapters as well as other frameworks using Spring Cloud Function as the core programming model (e.g., https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream]).
59
59
So in summary Spring Cloud Function instruments java functions with additional features to be utilised in variety of execution contexts.
60
60
61
61
62
62
[[function-definition]]
63
63
=== Function definition
64
-
While the previous example shows you how to lookup function in FunctionCatalog programmatically, in a typical integration case where Spring Cloud Function used as programming model by another framework (e.fg. Spring Cloud Stream), you declare which functions to use via `spring.cloud.function.definition` property. Knowing that it is important to understand some default behaviour when it comes to discovering functions in `FunctionCatalog`. For example, if you only have one Functional bean in your `ApplicationContext`, the `spring.cloud.function.definition` property typically will not be required, since a single function in `FunctionCatalog` can be looked up by an empty name or any name. For example, assuming that `uppercase` is the only function in your catalog, it can be looked up as `catalog.lookup(null)`, `catalog.lookup(“”)`, `catalog.lookup(“foo”)`
64
+
While the previous example shows you how to lookup function in FunctionCatalog programmatically, in a typical integration case where Spring Cloud Function used as programming model by another framework (e.g., https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream]), you declare which functions to use via `spring.cloud.function.definition` property. Knowing that it is important to understand some default behaviour when it comes to discovering functions in `FunctionCatalog`. For example, if you only have one Functional bean in your `ApplicationContext`, the `spring.cloud.function.definition` property typically will not be required, since a single function in `FunctionCatalog` can be looked up by an empty name or any name. For example, assuming that `uppercase` is the only function in your catalog, it can be looked up as `catalog.lookup(null)`, `catalog.lookup(“”)`, `catalog.lookup(“foo”)`.
65
65
That said, for cases where you are using framework such as Spring Cloud Stream which uses `spring.cloud.function.definition` it is best practice and recommended to always use `spring.cloud.function.definition` property.
66
66
67
67
For example,
@@ -169,7 +169,7 @@ And of course you can't compose uncomposable such as Consumer and Function, Cons
169
169
== Function Routing and Filtering
170
170
171
171
Since version 2.2 Spring Cloud Function provides routing feature allowing
172
-
you to invoke a single function which acts as a router to an actual function you wish to invoke
172
+
you to invoke a single function which acts as a router to an actual function you wish to invoke.
173
173
This feature is very useful in certain FAAS environments where maintaining configurations
174
174
for several functions could be cumbersome or exposing more than one function is not possible.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-function/standalone-web-applications.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ See <<Testing Functional Applications>> to see the details and example on how to
46
46
As you have noticed from the previous table, you can pass an argument to a function as path variable (i.e., `/\{function}/\{item}`).
47
47
For example, `http://localhost:8080/uppercase/foo` will result in calling `uppercase` function with its input parameter being `foo`.
48
48
49
-
While this is the recommended approach and the one that fits most use cases cases, there are times when you have to deal with HTTP request parameters (e.g., `http://localhost:8080/uppercase/foo?name=Bill`)
49
+
While this is the recommended approach and the one that fits most use cases cases, there are times when you have to deal with HTTP request parameters (e.g., `http://localhost:8080/uppercase/foo?name=Bill`).
50
50
The framework will treat HTTP request parameters similar to the HTTP headers by storing them in the `Message` headers under the header key `http_request_param`
51
51
with its value being a `Map` of request parameters, so in order to access them your function input signature should accept `Message` type (e.g., `Function<Message<String>, String>`). For convenience we provide `HeaderUtils.HTTP_REQUEST_PARAM` constant.
52
52
@@ -82,7 +82,7 @@ of the actual URL, giving user ability to use it for evaluation and computation.
82
82
83
83
In situations where there are more than one function in catalog there may be a need to only export certain functions or function compositions. In that case you can use
84
84
the same `spring.cloud.function.definition` property listing functions you intend to export delimited by `;`.
85
-
Note that in this case nothing will be mapped to the root path and functions that are not listed (including compositions) are not going to be exported
85
+
Note that in this case nothing will be mapped to the root path and functions that are not listed (including compositions) are not going to be exported.
86
86
87
87
For example,
88
88
@@ -101,7 +101,7 @@ This will only export function composition `foo|bar` and function `baz` regardle
101
101
== Http Headers propagation
102
102
103
103
By default most request `HttpHeaders` are copied into the response `HttpHeaders`. If you require to filter out certain headers you can provide the names of those headers using
104
-
`spring.cloud.function.http.ignored-headers` delimited by comas. For example, `spring.cloud.function.http.ignored-headers=foo,bar`
104
+
`spring.cloud.function.http.ignored-headers` delimited by comas. For example, `spring.cloud.function.http.ignored-headers=foo,bar`.
0 commit comments