Skip to content

Commit 00bd4dd

Browse files
committed
GH-1391 Add documentation explaining the new feature of the previous commit
Resolves #1391 Resolves #1419 Signed-off-by: Oleg Zhurakousky <ozhurakousky@vmware.com>
1 parent 4e7d9eb commit 00bd4dd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ In summary, Spring Cloud Function instruments Java functions with additional fea
6363
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.
6464
It is important to know and understand the default behaviour when it comes to discovering functions in `FunctionCatalog`.
6565

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.
6768
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”)`.
6869

6970
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,
7576
spring.cloud.function.definition=uppercase
7677
----
7778

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.
81+
7882
[[filtering-ineligible-functions]]
7983
=== Filtering ineligible functions
8084

0 commit comments

Comments
 (0)