Closed tvolkov closed 5 years ago
rxGetRecord
returns a Maybe
(before it was returning a Single
. So you need a flatMapSingle
.
discovery.rxGetRecord(svc -> svc.getName().equals("greetings"))
.map(discovery::getReference)
.map(serviceReference -> serviceReference.getAs(WebClient.class))
.flatMapSingle(webClient -> webClient.get("/greetings/vert.x-low-level-api").rxSend())
.map(HttpResponse::bodyAsString)
.subscribe(res -> System.out.println("result from the greeting service: " + res));
Thanks!
Hi,
I'm trying to accomplish exercise 4.2 (class
Exercise2Verticle
inmicroservices-exercises
module) and I get the compilation error in this piece:Intellij idea complains about the lambda passed to
flatMap
sayingRunning
mvn package
from withinmicroservices-exercises
module produces somewhat different error:Thanks!