Error in Running Pulser in frontend side
Closed this issue · 4 comments
its0beno commented
So i have been trying to send a simple request as a demo on the frontend on react js but am getting
const Pulasrclient = new PulsarClient.Client({
serviceUrl:"pulsar://192.168.100.38:6650",
operationTimeoutSeconds: 10,
connectionTimeoutSeconds: 5
});
async function connectToPulsar() {
try {
// Attempt to create a producer as a test for connection
const producer = await client.createProducer({
topic: 'persistent://public/default/test-topic'
});
await producer.close(); // Close the producer immediately after creation
console.log("Connected to Pulsar!");
} catch (error) {
console.error("Failed to connect to Pulsar:", error.message);
}
} ```
shibd commented
How did you install the Pulsar node.js client?
its0beno commented
i used
npm i pulsar-client
milobluebell commented
shibd commented
@its0beno @milobluebell I don't know what special environment is used on the frontend side. Can you provide more context? e.g., the version of Node.js, the specific reproduction steps, etc