kimula edited a comment on issue #131:
URL: 
https://github.com/apache/pulsar-client-node/issues/131#issuecomment-720263581


   @steelone 
   i succeeded to run your example and reproduce the problem (it was due to not 
your example but my environment).
   i think that using `listener` instead of `while` loop makes it work.
   like:
   ```javascript
   const consumer = await client.subscribe({
       topic,
       subscription: 'sub1',
       subscriptionType,
       listener: (msg, consumer) => {
           try {
               consumer.acknowledge(msg);
               onMessage(msg.getData().toString());
           } catch (e) {
               consumer.close();
               onError(e);
           }
       }
   });
   ```


-- 
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: dev-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to