I am developing an application where I am listing to incoming RabbitMQ messages. I am using Node.JS and the amqplib library. As my process manager I use pm2. I am listening to a topicExchange
from RabbitMQ and there a multiple variants of topics that will be created like *.*
, foo.*
, *.bar
, foo.bar
.
When receiving the event from RabbitMQ my script is making an follow up http request afterwards with different payload based on the topic key.
I am asking myself now is there any difference in regards to performance if I loop all possible topicKeys in one script / one pm2 process and create n-new channels / connections to RabbitMQ within one process or should I create multiple pm2 processes where each pm2 process listens / creates only one new channel to a single topicKey.
If I create multiple pm2 instances of my listeners I would use more RAM but would it be faster?