June 2018
Beginner
722 pages
18h 47m
English
We implemented the message publisher very similarly to the message sender:
package com.packt.javapath.ch18demo.reactivesystem;import io.vertx.rxjava.core.AbstractVerticle;import io.vertx.rxjava.core.http.HttpServer;public class EventBusPublish extends AbstractVerticle { private int port; private String address, name; public EventBusPublish(int port, String address) { this.port = port; this.address = address; this.name = this.getClass().getSimpleName() + "(port " + port + ", publish to " + address + ")"; } public void start() throws Exception { System.out.println(name + " starts..."); HttpServer server = vertx.createHttpServer(); server.requestStream().toObservable() .subscribe(request -> { String msg = request.getParam( ...
Read now
Unlock full access