ltecze opened a new issue, #394:
URL: https://github.com/apache/pulsar-client-node/issues/394

   I'm not able to create producer or consumer. I only get the error [Error: 
Failed to create producer: TimeOut]. I see opening and closing connection in 
broker log. I'm able to connect pulsar broker with Pulsar-Manager (the same 
netrwork, docker-compose).
   
   used docker-compose:
   
   services:
     pulsar:
       image: apachepulsar/pulsar:3.3.1
   #    command: bin/pulsar standalone
       command: sh -c "bin/apply-config-from-env.py conf/standalone.conf && 
bin/pulsar standalone"
       hostname: pulsar-local
       ports:
         - "8080:8080"
         - "6650:6650"
       restart: unless-stopped
       volumes:
         - "./conf:/pulsar/conf"
     dashboard:
       image: apachepulsar/pulsar-manager:v0.4.0
       ports:
         - "9527:9527"
         - "7750:7750"
       depends_on:
         - pulsar
       links:
         - pulsar
       environment:
         SPRING_CONFIGURATION_FILE: 
/pulsar-manager/pulsar-manager/application.properties
   
   used nodejs client app:
   
   const Pulsar = require("pulsar-client");
   
   async function produceTest(timeout) {
     const client = new Pulsar.Client({
       serviceUrl: "pulsar://host.docker.internal:6650"
     });
   
     console.log('Create producer....');
   
     try {
       
       const producer = await client.createProducer({
         topic: "persistent://public/default/test1",
         sendTimeoutMs: 30000
       });
   
       console.log('before');
   
       await new Promise((resolve, reject) => {
         setTimeout(() => {
           producer.send({
             data: Buffer.from("My Message")
           });
           resolve();
         }, timeout);
       });
   
     } catch(e) {
   
       console.error(e);
     }
     
   
     console.log('after');
   
     await client.close();
   }


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to