January 2018
Intermediate to advanced
414 pages
10h 29m
English
As with the annotated base system, first we need to define how our microservice will handle incoming requests, but instead of creating a controller, we will use a RouterFunction.
First, we will create a new class named CustomerRouter, with a RouterFunction:
package com.microservices.chapter4import org.springframework.context.annotation.Beanimport org.springframework.stereotype.Componentimport org.springframework.web.reactive.function.server.RouterFunctionimport org.springframework.web.reactive.function.server.router@Componentclass CustomerRouter { @Bean fun customerRoutes(): RouterFunction<*> = router { "/functional".nest { } }}
We are creating a new component, so it will be picked up by the component scan that exposes ...
Read now
Unlock full access