News for hackers. Stuff that matters.
Re:Apache Pulsar is an open-source distributed pub-sub messa... by tyingq on Thursday January 02, 2020 @11:02AM (#21936460)
Re:Apache Pulsar is an open-source distributed pub-sub messa... by c0brac0bra on Thursday January 02, 2020 @11:23AM (#21936694)
However it currently lacks the ability to listen for messages and run an event handler when one comes in: https://github.com/apache/pulsar-client-node/pull/56

You have to manually call ".receive()" to attempt to receive a message.

Re:Apache Pulsar is an open-source distributed pub-sub messa... by gperinazzo on Thursday January 02, 2020 @12:47PM (#21937689)
Using `.receive()` will occupy a worker thread from node until it returns. Having multiple consumers waiting on receive will clog up the worker threadpool, preventing anything that uses it from running. If you want to use the consumer right now, I would suggest always using a timeout on the receive call, and waiting between timed-out calls to receive. This is extremely important if you have multiple consumers.