Interface RouteResolver

  • All Known Implementing Classes:
    LongestFirstRouteResolver

    public interface RouteResolver
    Algorithm for resolving route, which will decide which connector socket to be used.
    • Method Detail

      • resolve

        default String resolve​(Set<String> routes,
                               String target)
        resolve the route which will decide which connector socket to be used

        the default implementation using the first segment of the target and do an exact match. If no matching found, returning "*"

        Parameters:
        routes - all the existing routes in cranker
        target - requests uri path, e.g. /my-service/api
        Returns:
        route, return "*" or null will result in using the "catchAll" route in cranker