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
{{ message }}
This repository was archived by the owner on Mar 13, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+18-8Lines changed: 18 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,15 @@ file, which can be shaded with all required dependencies, or it can be
15
15
a Spring Boot fat jar (with dependencies nested in
16
16
`BOOT-INF/lib`). Simple functions that do not require any dependencies
17
17
work just fine. The simplest form of the handler is a class name that
18
-
can be instantiated (with a default constructor). More complex creation scenarios can be handled by giving the handler in the form `<bean>&main=<main>` where
18
+
can be instantiated (with a default constructor). More complex creation scenarios can be handled by giving the handler in the form `<bean>[&main=<main>]` where
19
19
20
20
*`<bean>` is a class name or bean name, and
21
21
*`<main` is a Spring `@Configuration` class to create an application context
22
22
23
23
If you provide a `main` parameter you need to include Spring Boot and
24
-
all the other dependencies of the context in your archive. If the
24
+
all the other dependencies of the context in your archive. A Spring
25
+
Boot jar file does not need an explicit `main` (there is one in the
26
+
`MANIFEST.MF`), but if you supply one it will be used. If the
25
27
`Function` has POJO (i.e. not generic JDK classes) as parameter types,
26
28
then you also need to depend on `spring-cloud-function-context` (and
27
29
include that in the archive).
@@ -32,10 +34,16 @@ Example:
32
34
riff init java -i greetings -a target/greeter-1.0.0.jar --handler=functions.Greeter
33
35
```
34
36
35
-
Example with Spring application context (Note: you need to add quotes around the handler value since it contains an `&`)
37
+
Example with Spring Boot application:
36
38
37
39
```
38
-
riff init java -i greetings -a target/greeter-1.0.0.jar --handler='greeter&main=functions.Application'
40
+
riff init java -i greetings -a target/greeter-1.0.0.jar --handler=greeter
41
+
```
42
+
43
+
Example with Spring application context and an explicit main (Note: you need to add quotes around the handler value since it contains an `&`)
44
+
45
+
```
46
+
riff init java -i greetings -a target/greeter-1.0.0.jar --handler='greeter&main=functions.FunctionApp'
39
47
```
40
48
41
49
As long as the dependencies are included in the archive correctly, you
@@ -62,10 +70,12 @@ classpath archive, which can be a jar file or a directory, together
62
70
with parameters:
63
71
64
72
*`handler`: the class name of a `Function` to execute, or (when
65
-
`main` is also provided) a bean name of a `Function`.
66
-
*`main`: the class name of a Spring `@Configuration` that can be used
67
-
to create a Spring application context, in which the `handler` is
68
-
defined.
73
+
`main` is also used) a bean name of a `Function`. Can also be a
74
+
comma, or pipe-separated list of functions, which are composed
75
+
together at runtime.
76
+
*`main`: (optional) the class name of a Spring `@Configuration` that
77
+
can be used to create a Spring application context, in which the
78
+
`handler` is defined.
69
79
70
80
The jar archive can also be a comma-separated list of archive
71
81
locations, in case you need to compose things together.
0 commit comments