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 Details

    • functionDefinition

      @Deprecated default String functionDefinition(org.springframework.messaging.Message<?> message)
      Deprecated.
      in 3.1 in favor of routingResult(Message)
    • routingResult

      default MessageRoutingCallback.FunctionRoutingResult routingResult(org.springframework.messaging.Message<?> message)
      Computes and returns the instance of MessageRoutingCallback.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