Interface MessageRoutingCallback


public interface MessageRoutingCallback
Java-based strategy to assist with determining the name of the route-to function definition. Once an 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, John Blum
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    routingResult(org.springframework.messaging.Message<?> message)
    Computes and returns an instance of String, which encapsulates, at the very minimum, a function definition.
  • Method Details

    • routingResult

      default String routingResult(org.springframework.messaging.Message<?> message)
      Computes and returns an instance of String, which encapsulates, at the very minimum, a 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 String containing the result of the routing computation