January 2018
Intermediate to advanced
414 pages
10h 29m
English
Now, we need to create our route to handle an HTTP GET request with a READ operation on the service. Let's first create our CustomerHandler class:
package com.microservices.chapter5import org.springframework.http.HttpStatusimport org.springframework.stereotype.Componentimport org.springframework.web.reactive.function.BodyInserters.fromObjectimport org.springframework.web.reactive.function.server.ServerRequestimport org.springframework.web.reactive.function.server.ServerResponse.okimport org.springframework.web.reactive.function.server.ServerResponse.status@Componentclass CustomerHandler(val customerService: CustomerService) { fun get(serverRequest: ServerRequest) = customerService.getCustomer(serverRequest.pathVariable( ...
Read now
Unlock full access