From bdd0c417acdab3ddb813063e363c3f3dfb382b2a Mon Sep 17 00:00:00 2001 From: Victor Hugo Pongolino <78983900+VictorPongolino@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:45:15 -0300 Subject: [PATCH 1/4] Fixes typo FunctionRoutingResult to String --- .../pages/spring-cloud-function/programming-model.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc index 38e4b59fe..1b8bb3e9a 100644 --- a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc @@ -195,8 +195,9 @@ The `MessageRoutingCallback` is a strategy to assist with determining the name o [source, java] ---- public interface MessageRoutingCallback { - FunctionRoutingResult routingResult(Message message); - . . . + default String routingResult(Message message) { + return (String) message.getHeaders().get("spring.cloud.function.definition"); + } } ---- @@ -739,4 +740,4 @@ private final static JsonMasker masker = JsonMasker.INSTANCE(); . . . logger.info("Received: " + masker.mask(new String(payload, StandardCharsets.UTF_8))); ----- \ No newline at end of file +---- From 23a69512df0311ce7d2e9483202a5daf0c19245c Mon Sep 17 00:00:00 2001 From: Victor Hugo Pongolino <78983900+VictorPongolino@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:14:28 -0300 Subject: [PATCH 2/4] Fix typo in docs replacing FunctionRoutingResult to String in MessageRoutingCallback --- .../cloud/function/context/MessageRoutingCallback.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/MessageRoutingCallback.java b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/MessageRoutingCallback.java index 2ba6000f3..6f3b2a506 100644 --- a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/MessageRoutingCallback.java +++ b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/MessageRoutingCallback.java @@ -33,7 +33,7 @@ public interface MessageRoutingCallback { /** - * Computes and returns the instance of {@link FunctionRoutingResult} which encapsulates, + * Computes and returns the instance of {@link String} which encapsulates, * at the very minimum, function definition. *

* Providing such message is primarily an optimization feature. It could be useful for cases @@ -42,7 +42,7 @@ public interface MessageRoutingCallback { * message for downstream use didn't exist, resulting in repeated transformation, type conversion etc. * * @param message input message - * @return instance of {@link FunctionRoutingResult} containing the result of the routing computation + * @return instance of {@link String} containing the result of the routing computation */ default String routingResult(Message message) { return (String) message.getHeaders().get(FunctionProperties.FUNCTION_DEFINITION); From 27ca5c37fcbd2745d8d5f42e2e3cd019deb1130b Mon Sep 17 00:00:00 2001 From: Victor Hugo Pongolino <78983900+VictorPongolino@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:20:38 -0300 Subject: [PATCH 3/4] Updates the mention to MessageRoutingCallback to the correct method version --- .../ROOT/pages/spring-cloud-function/programming-model.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc index 1b8bb3e9a..ff5d3cc6e 100644 --- a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc @@ -196,8 +196,8 @@ The `MessageRoutingCallback` is a strategy to assist with determining the name o ---- public interface MessageRoutingCallback { default String routingResult(Message message) { - return (String) message.getHeaders().get("spring.cloud.function.definition"); - } + return (String) message.getHeaders().get(FunctionProperties.FUNCTION_DEFINITION); + } } ---- From d417740d67f19e1954eb9cd4cf4cccd878b7e40c Mon Sep 17 00:00:00 2001 From: Victor Hugo Pongolino <78983900+VictorPongolino@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:25:10 -0300 Subject: [PATCH 4/4] Formatting fix --- .../ROOT/pages/spring-cloud-function/programming-model.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc index ff5d3cc6e..818265dbf 100644 --- a/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-function/programming-model.adoc @@ -196,8 +196,8 @@ The `MessageRoutingCallback` is a strategy to assist with determining the name o ---- public interface MessageRoutingCallback { default String routingResult(Message message) { - return (String) message.getHeaders().get(FunctionProperties.FUNCTION_DEFINITION); - } + return (String) message.getHeaders().get(FunctionProperties.FUNCTION_DEFINITION); + } } ----