July 2018
Intermediate to advanced
268 pages
7h 36m
English
Incoming requests are intercepted by RouterFunction, and, according to the configured route, it is navigated to the right HandlerFunction. If the route is matched; RouterFunction takes in ServerRequest and returns back Mono<HandlerFunction>. If not, empty Mono is returned.
RouterFunction is created as shown in the following code snippet:
RouterFunctions.route(RequestPredicate, HandlerFunction)
RequestPredicate is a utility class that has predefined matching patterns for most of the common use cases, such as matching based on path, content type, HTTP method, and so on. An example code snippet for RouterFunction is as follows:
RouterFunction<ServerResponse> routeFunctionSample = RouterFunctions.route(RequestPredicates.path("/sample-route"), ...Read now
Unlock full access