When attempting to create a topic on Apache Pulsar during testing using Node.js, the following errors occurred:
[[::1]:53665 -> [::1]:6650] Failed partition-metadata lookup req_id: 10 error: Retryable msg: org.apache.pulsar.client.api.PulsarClientException: Connection already closed
Error encountered while checking/getting partition metadata when creating a producer on persistent://public/default/payment-topic -- TimeOut
[[::1]:53665 -> [::1]:6650] Read operation failed: Bad file descriptor
Even after several retries, the topic creation remains unsuccessful, and the error message "Failed to create producer: TimeOut" persists.
The following is my code:
import { AuthenticationToken, Client, LogLevel } from 'pulsar-client';
const paymentPulsarClient = new Client({
serviceUrl: 'pulsar://localhost:6650',
authentication: new AuthenticationToken({
token: 'xxxxx',
})
});
const producer = await paymentPulsarClient.createProducer({
topic: 'payment-topic',
sendTimeoutMs: 30_000,
batchingEnabled: true,
});