Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with version 1.10 and onwards on windows #381

Open
suneab opened this issue May 2, 2024 · 2 comments
Open

Issue with version 1.10 and onwards on windows #381

suneab opened this issue May 2, 2024 · 2 comments

Comments

@suneab
Copy link

suneab commented May 2, 2024

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();
})();
@JimmyBjorklund
Copy link

We get similar issue; we get instant timeout when creating producer.

@JimmyBjorklund
Copy link

Any update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants