apache / apache/pulsar-client-node

Issue with version 1.10 and onwards on windows

Ouverte
#381 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
164
Forks
98
Métriques de merge des PR
Aucune PR mergée en 30 j

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();
})();
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par exécuter l’exemple du README sous Windows avec AuthenticationOauth2 et comparez les versions 1.9, 1.10 et 1.11. Concentrez-vous sur l’appel à createProducer et sur l’AuthenticationError signalée ; le travail est terminé lorsque vous avez identifié pourquoi l’authentification échoue dans les versions concernées et confirmé que la création du producteur fonctionne avec le comportement corrigé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
api, backend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.