use of io.vertx.examples.service.impl.ProcessorServiceImpl in project vertx-examples by vert-x3.
the class ProcessorServiceVerticle method start.
@Override
public void start() throws Exception {
// Create the client object
service = new ProcessorServiceImpl();
// Register the handler
ProxyHelper.registerService(ProcessorService.class, vertx, service, "vertx.processor");
//
Router router = Router.router(vertx);
// Allow events for the designated addresses in/out of the event bus bridge
BridgeOptions opts = new BridgeOptions().addInboundPermitted(new PermittedOptions().setAddress("vertx.processor")).addOutboundPermitted(new PermittedOptions().setAddress("vertx.processor"));
// Create the event bus bridge and add it to the router.
SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
router.route("/eventbus/*").handler(ebHandler);
//
router.route().handler(StaticHandler.create());
//
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
}
Aggregations