#Running multiple instances of NestJS with BullMQ - race conditions?

1 messages · Page 1 of 1 (latest)

lunar shell
#

Hey, I would like to ask whether there would be any race conditions running multiple instances of NestJS within AWS ECS e.g. Fargate, since my NestJS app will be stateless monolith/microservice application.

Kind Regards,
Tomasz

#

I am just worried, since I can spawn multiple instances of NestJS server, and spawn multiple instances of Worker threads, I have read about Worker threads, but I think there was missing part in regard of multiple server instances, or I have just missed it, sorry.

nimble python
#

As stated in bullmq docs: https://docs.bullmq.io/

The library is designed so that it will fulfill the following goals:

  • Exactly once queue semantics, i.e., attempts to deliver every message exactly one time, but it will deliver at least once in the worst case scenario*.
  • Easy to scale horizontally. Add more workers for processing jobs in parallel.

So, you shouldn't need to worry about race conditions.

lunar shell
#

Sorry for bringing you out there for this question, my mistake I was not following the docs from nestjs to bullmq