apache / apache/pulsar-client-node

Issue with version 1.10 and onwards on windows

未关闭
#381 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
164
派生
98
PR 合并指标
30 天内没有已合并 PR

描述

Hi!
I'm building an application using pulsar and everything works fine on the latest version on macos. After some trial and error on my windows pc. it seems there is an issue with version 1.10 and 1.11 on windows. if i change the version to 1.9 it works again.

I used slightly modified version of the example from readme to test this. Only difference is i added authentication, so it might just be a problem with that.

I get this error:
```
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

[Error: Failed to create producer: AuthenticationError]
```

Full code example:
```
const Pulsar = require('pulsar-client');

const DEV_DEFAULTS = {
serviceUrl: "SECRET",
type: "client_credentials",
issuer_url: "SECRET",
audience: "SECRET",
scope: "SECRET",
};
const clientConfig = {
name: "SECRET",
clientId: "SECRET",
clientSecret: "SECRET",
};
(async () => {
// Create a client
const client = new Pulsar.Client({
serviceUrl: DEV_DEFAULTS.serviceUrl,
authentication: new Pulsar.AuthenticationOauth2({
...DEV_DEFAULTS,
client_id: clientConfig.clientId,
client_secret: clientConfig.clientSecret,
})
});

// Create a producer
const producer = await client.createProducer({
topic: 'SECRET',
});

// Create a consumer
const consumer = await client.subscribe({
topic: 'SECRET',
subscription: 'SECRET'
});

// Send a message
producer.send({
data: Buffer.from("hello")
});

// Receive the message
const msg = await consumer.receive();
console.log(msg.getData().toString());
consumer.acknowledge(msg);

await producer.close();
await consumer.close();
await client.close();
})();
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先,在 Windows 上使用 AuthenticationOauth2 运行 README 示例,并比较 1.9、1.10 和 1.11 版本。重点关注 createProducer 调用以及报告的 AuthenticationError;完成标准是确定受影响版本中身份验证失败的原因,并确认使用修正后的行为可以成功创建 producer。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。