hrsakai commented on issue #56: Add listener support for consumer
URL: https://github.com/apache/pulsar-client-node/pull/56#issuecomment-547724476
 
 
   I can receive only one message when `ack(message)` doesn’t be called.
   ```
   // Execute consumer
   $ node ./consumer_listener.js
   results.length: 1
   
   // Produce messages on another terminal
   $ pulsar-client produce -n 100 -m Hello persistent://public/ns/topic1
   ```
   
   consumer_listener.js
   ```
   .
   .
     const consumer = await client.subscribe({
       topic: 'persistent://public/ns/topic1',
       subscription: 'sub1',
       listener: (message, ack) => {
         const data = message.getData().toString();
         results.push(data);
         console.log(`results.length: ${results.length}`);
   //      ack(message);
         if (results.length === 10000) finish();
       },
     });
   .
   .
   ```

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