Vertx Bridge弃用的PermittedOptions

问题描述 投票:0回答:1

我已经可以通过有关官方文档的套接字公开Vert.x EventBus

https://vertx.io/docs/vertx-sockjs-service-proxy/java/

目的是与NodeJS应用程序进行交互。对于初始测试,消息已经在普通Verticals和Node App

之间工作

但是,我已经看到类io.vertx.ext.web.handler.sockjs.PermittedOptions已被弃用。

这是代码段

import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.sockjs.BridgeOptions;
import io.vertx.ext.web.handler.sockjs.PermittedOptions;
import io.vertx.ext.web.handler.sockjs.SockJSHandler;

.
.
.

Router router = Router.router(vertx);

BridgeOptions opts = new BridgeOptions()
                          .addInboundPermitted(new PermittedOptions().setAddress("nodetest"))
                          .addOutboundPermitted(new PermittedOptions().setAddress("nodetest"));

router.mountSubRouter("/eventbus", SockJSHandler.create(vertx).bridge(opts));

vertx.createHttpServer().requestHandler(router).listen(3000, res -> {
      if (res.succeeded())
        promise.complete();
      else
        promise.fail(res.cause());
    });
.
.
.

¿正确的进行方式是什么?

node.js vert.x sockjs
1个回答
0
投票

您提到的类在2个存储库中重复,“修复”仅用于将import语句更新为正确的一个:

io.vertx.ext.bridge.PermittedOptions

其余所有内容均应按预期工作。

© www.soinside.com 2019 - 2024. All rights reserved.