Interface MessageRoutingCallback
public interface MessageRoutingCallback
Java-based strategy to assist with determining the name of the route-to function definition.
Once implementation is registered as a bean in application context
it will be picked up by the
RoutingFunction
.
While RoutingFunction
provides several mechanisms to determine the route-to function definition
this callback takes precedence over all of them.- Since:
- 3.1
- Author:
- Oleg Zhurakousky
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Domain object that represents the result of theroutingResult(Message)
computation. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
functionDefinition
(org.springframework.messaging.Message<?> message) Deprecated.routingResult
(org.springframework.messaging.Message<?> message) Computes and returns the instance ofMessageRoutingCallback.FunctionRoutingResult
which encapsulates, at the very minimum, function definition and optionally Message to be used downstream.
-
Method Details
-
functionDefinition
Deprecated.in 3.1 in favor ofroutingResult(Message)
-
routingResult
default MessageRoutingCallback.FunctionRoutingResult routingResult(org.springframework.messaging.Message<?> message) Computes and returns the instance ofMessageRoutingCallback.FunctionRoutingResult
which encapsulates, at the very minimum, function definition and optionally Message to be used downstream.
Providing such message is primarily an optimization feature. It could be useful for cases where routing procedure is complex and results in, let's say, conversion of the payload to the target type, which would effectively be thrown away if the ability to modify the target message for downstream use didn't exist, resulting in repeated transformation, type conversion etc.- Parameters:
message
- input message- Returns:
- instance of
MessageRoutingCallback.FunctionRoutingResult
containing the result of the routing computation
-
routingResult(Message)