Issue with version 1.10 and onwards on windows

Open
#381 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
api, backend

Research direction

Start by running the README example on Windows with AuthenticationOauth2 and compare versions 1.9, 1.10, and 1.11. Focus on the createProducer call and the reported AuthenticationError; done means identifying why authentication fails on the affected versions and confirming producer creation works with the corrected behavior.

Written by the indexing model from the issue text.

Description

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();
})();
Dominant language
C++
Stars
164
Forks
99
Avg merge
5d 18h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/pulsar-client-node

All issues in apache/pulsar-client-node

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.