使用节点npm ksqldb-client抛出超时错误执行ksql查询

发布于 2025-01-26 08:38:18 字数 1050 浏览 5 评论 0原文

嗨,我正在尝试使用NPM软件包KSQLDB-CLIENT软件包执行KSQL查询,它会引发超时错误。我也附上了代码,请让我知道那里的任何问题。 当点get url下面的方法将执行https:// localhost:5000/testksql

exports.getKSQLStream = async () => {
    const options = {
        authorization: {
            username: "admin",
            password: "pw",
            ssl: {
                ca:  CAs,
                crt: myClientCert,
                key: myClientKey,
            }
        },
        host:  'https://ixxxx.xcxx.net',
        timeout: 20000
    }
    const client = new KsqldbClient(options);
    await  client.connect();
    const streamRes = await  client.query('list streams;');
    console.log("streams",streamRes);
    await  client.disconnect();
}

当我从邮递员中击中该URL时,在节点控制台中的响应低于响应。

Error on Http2 client. Error: connect ETIMEDOUT 16.2XX.X4.xxx:8088
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '16.2XX.X4.xxx',
  port: 8088
}

Hi am trying to execute the KSQL query using npm package ksqlDb-client package, it throws an timeout error. I have attached the code as well, please let me know any issues over there.
when am hit this GET URL below method will execute https://localhost:5000/testKsql

exports.getKSQLStream = async () => {
    const options = {
        authorization: {
            username: "admin",
            password: "pw",
            ssl: {
                ca:  CAs,
                crt: myClientCert,
                key: myClientKey,
            }
        },
        host:  'https://ixxxx.xcxx.net',
        timeout: 20000
    }
    const client = new KsqldbClient(options);
    await  client.connect();
    const streamRes = await  client.query('list streams;');
    console.log("streams",streamRes);
    await  client.disconnect();
}

when I hit that URL from postman am getting below response in node console.

Error on Http2 client. Error: connect ETIMEDOUT 16.2XX.X4.xxx:8088
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '16.2XX.X4.xxx',
  port: 8088
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可遇━不可求 2025-02-02 08:38:18

我最近面对同一问题,发现图书馆有授权的错误。我将PR推送为Repo,但是您可以以相同的方式修补本地副本。

https://github.com/streaminy/streaminy/ksqldb-client/pull/pull/pull/4

I faced recently with the same issue and found that library has bug with authorization. I pushed PR in repo, but you can patch your local copy in the same way.

https://github.com/Streaminy/ksqldb-client/pull/4

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文