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/spring-cloud-function/programming-model.adoc
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,8 @@ In summary, Spring Cloud Function instruments Java functions with additional fea
63
63
While the previous example shows you how to lookup a function in `FunctionCatalog` programmatically, in a typical integration case where Spring Cloud Function is used as the programming model by another framework (e.g. https://spring.io/projects/spring-cloud-stream[Spring Cloud Stream]), you can declare which functions to use via the `spring.cloud.function.definition` property.
64
64
It is important to know and understand the default behaviour when it comes to discovering functions in `FunctionCatalog`.
65
65
66
-
For instance, 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.
66
+
For instance, 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`
67
+
can be looked up by an empty name, or any name.
67
68
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”)`.
68
69
69
70
That said, for cases where you are using a framework such as Spring Cloud Stream, which uses `spring.cloud.function.definition`, it is recommended to always use the `spring.cloud.function.definition` property.
@@ -75,6 +76,9 @@ For example,
75
76
spring.cloud.function.definition=uppercase
76
77
----
77
78
79
+
If you do not wish to lookup a single function by an empty string or any name, you can set the `spring.cloud.function.single-function-fallback-enabled`
80
+
property to `false`, thus ensuring that function is looked up only by its proper name.
0 commit comments