June 2018
Beginner
722 pages
18h 47m
English
We can use periodic service verticals to send messages to the server vertical using the HTTP protocol. In order to do it, we need a new dependency, so we can use the WebClient class:
<dependency> <groupId>io.vertx</groupId> <artifactId>vertx-web-client</artifactId> <version>${vertx.version}</version></dependency>
With that, the periodic service that sends messages to the HTTP server vertical looks like this:
package com.packt.javapath.ch18demo.microservices;import io.vertx.rxjava.core.AbstractVerticle;import io.vertx.rxjava.core.buffer.Buffer;import io.vertx.rxjava.ext.web.client.HttpResponse;import io.vertx.rxjava.ext.web.client.WebClient;import rx.Single;import java.time.LocalTime;import java.time.temporal.ChronoUnit ...
Read now
Unlock full access