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 theRoutingFunction
. WhileRoutingFunction
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 Classes Modifier and Type Interface Description static class
MessageRoutingCallback.FunctionRoutingResult
Domain object that represents the result of theroutingResult(Message)
computation.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default String
functionDefinition(org.springframework.messaging.Message<?> message)
Deprecated.in 3.1 in favor ofroutingResult(Message)
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.
-
-
-
Method Detail
-
functionDefinition
@Deprecated default String functionDefinition(org.springframework.messaging.Message<?> message)
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
-
-