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
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
routingResult
(org.springframework.messaging.Message<?> message) Computes and returns the instance ofFunctionRoutingResult
which encapsulates, at the very minimum, function definition.
-
Method Details
-
routingResult
Computes and returns the instance ofFunctionRoutingResult
which encapsulates, at the very minimum, function definition.
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
FunctionRoutingResult
containing the result of the routing computation
-