The worker: process, retry, and fail safely

The other half: a processor pulls jobs off

The producer put a job in Redis. Now something has to take it out and do the work. In @nestjs/bullmq that's a processor: a class decorated with @Processor("emails") that extends WorkerHost and implements one process(job) method. Nest spins up a BullMQ worker bound to that queue and calls process for every job.

One process method handles every job on the queue; you branch on job.name when a queue carries more than one kind of work. The job's payload is on job.data β€” for us, { bookingId }.

Note: the older @nestjs/bull package used a per-method @Process("name") decorator. Modern @nestjs/bullmq gives each processor a single process() method instead β€” switch on job.name inside it.