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/src/main/asciidoc/spring-cloud-function.adoc
-11
Original file line number
Diff line number
Diff line change
@@ -193,17 +193,6 @@ public MessageRoutingCallback customRouter() {
193
193
In the preceding example you can see a very simple implementation of `MessageRoutingCallback` which determines the function definition from
194
194
`func_name` Message header of the incoming Message and returns the instance of `FunctionRoutingResult` containing the definition of function to invoke.
195
195
196
-
Additionally, the `FunctionRoutingResult` provides another constructor allowing you to provide an instance of `Message` as second argument to be used down stream.
197
-
This is primarily for runtime optimizations. To better understand this case let's look at the following scenario.
198
-
You need to route based on the payoload type. However, an input Message typically comes in as let's say JSON payload (as `byte[]`) . In order
199
-
to determine the route-to function definition you need to first process such JSON and potentially create an instance of the target type.
200
-
Once that determination is done you can pass it to `RoutingFunction` which still has a reference to the original Message with un-processed payload
201
-
This means that somewhere downstream, type conversion/transformation would need to be repeated.
202
-
203
-
Allowing you to create a new `Message` with converted payload as part of the `FunctionRoutingResult` will instruct `RoutingFunction` to use such `Message`
204
-
downstream. So effectively you letting the framework to benefit from the work you already did.
205
-
206
-
207
196
*Message Headers*
208
197
209
198
If the input argument is of type `Message<?>`, you can communicate routing instruction by setting one of
Copy file name to clipboardExpand all lines: spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/MessageRoutingCallback.java
+3-43
Original file line number
Diff line number
Diff line change
@@ -32,17 +32,9 @@
32
32
*/
33
33
publicinterfaceMessageRoutingCallback {
34
34
35
-
/**
36
-
* @deprecated in 3.1 in favor of {@link #routingResult(Message)}
Copy file name to clipboardExpand all lines: spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/config/RoutingFunction.java
Copy file name to clipboardExpand all lines: spring-cloud-function-context/src/test/java/org/springframework/cloud/function/context/MessageRoutingCallbackTests.java
+2-3
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ public MessageRoutingCallback messageRoutingCallback(JsonMapper jsonMapper) {
Copy file name to clipboardExpand all lines: spring-cloud-function-rsocket/src/test/java/org/springframework/cloud/function/rsocket/MessageRoutingCallbackRSocketTests.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ public static class RoutingCallbackFunctionConfiguration {
0 commit comments