alijmlzd opened a new issue #78: Error: Failed to send message: AlreadyClosed 
URL: https://github.com/apache/pulsar-client-node/issues/78
 
 
   Hi there,
   Why this example with 1 second timeout works fine:
   ```js
   const client = new Pulsar.Client({
       serviceUrl: 'pulsar://localhost:6650',
   })
   
   const producer = await client.createProducer({
       topic: 'persistent://public/default/my-topic',
   })
   
   setTimeout(async() => {
       producer.send({
           data: Buffer.from('My Message'),
       })
   }, 1000)
   ```
   But this example with a few more seconds timeout occurs an error?
   ```js
   const client = new Pulsar.Client({
       serviceUrl: 'pulsar://localhost:6650',
   })
   
   const producer = await client.createProducer({
       topic: 'persistent://public/default/my-topic',
   })
   
   setTimeout(async() => {
       producer.send({
           data: Buffer.from('My Message'),
       })
   }, 9000)
   ```
   Full error message:
   ```
   You have triggered an unhandledRejection, you may have forgotten to catch a 
Promise rejection:
   Error: Failed to send message: AlreadyClosed
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to