【问题标题】:vertx timeout if async result is failed如果异步结果失败,则 vertx 超时
【发布时间】:2018-06-29 22:36:49
【问题描述】:

当服务器端服务以失败结果结束时,我在浏览器中看到超时。如果服务调用成功,一切正常,但如果调用失败,浏览器似乎永远不会收到响应。

我的服务将结果处理程序传递给包含以下代码的 DAO:

final SQLConnection conn = ar.result();
conn.updateWithParams(INSERT_SQL, params, insertAsyncResult -> {

    if (insertAsyncResult.failed()) {
        conn.close();
        resultHandler.handle(ServiceException.fail(1, "TODO"));
    } else {
        resultHandler.handle(Future.succeededFuture());
    }

});

我不知道从这里去哪里。如何调试框架发送回客户端的内容?

【问题讨论】:

    标签: vert.x


    【解决方案1】:

    问题是我需要在中间 Verticle 中注册一个 ServiceExceptionMessageCodec,它位于浏览器和执行数据库操作的 Verticle 之间。

    【讨论】:

      猜你喜欢
      • 2019-11-11
      • 1970-01-01
      • 1970-01-01
      • 2016-02-15
      • 1970-01-01
      • 2021-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多