Tal
Tal

Reputation: 23

What is the difference between BullMQ and message queue?

I have a user creation use-case: When user created, a welcome mail should be sent to him.

In my current implementation, I have 2 services:

I created a "notification queue" using BullMQ.
When new user is created (via the user service), the user service adds a new job to the notification-queue and the notification service (as a worker of this queue) picks up the job and send the welcome mail to the user.

I chose BullMQ as it was pretty easy to set up and I could utilize many benefits like job priority, rate limit, and concurrency processing of jobs.

What is the difference between BullMQ and other messages queues like rabbitMQ? I know BullMQ and rabbitMQ are totally different things (job queue vs message queue), but as I don׳t really know the differences, I still don׳t know which one of them is best for a use-case like mine...
What should I consider when choosing between the two?

Also, the fact that in my case the user service don׳t expect any response in return, a notification service feels to be more suited for events...(like, the user service should publish an event "user-created" and the notification service should be a subscriber to this event and operate on it..). Is this "Event-driven design" can be accomplished with queues?

Upvotes: 2

Views: 1971

Answers (1)

Abhishek Singh
Abhishek Singh

Reputation: 729

RabbitMq is a message broker. Massage broker takes message from a producer and routes it to consumer.

BullMq is a nodejs library which uses redis as message broker.

Upvotes: 0

Related Questions