Installation
Since @nemoventures/adonis-jobs
supports both BullMQ and BullMQ Pro, you need to install the appropriate package based on your needs.
# For BullMQ (open-source version)
npm install bullmq
# For BullMQ Pro (enterprise version)
npm install @taskforcesh/bullmq-pro
Install package
Install and configure the package in your AdonisJS application.
node ace add @nemoventures/adonis-jobs
This command will:
- Install the package
- Create the queue configuration file at
config/queue.ts
- Set up the necessary providers/commands in your
adonisrc.ts
Directory path
After installation, you need to create a directory for your jobs and configure it in your adonisrc.ts
file.
1. Create the jobs directory
First, create the app/jobs
directory in your project:
mkdir app/jobs
2. Configure the directory path
Add the jobs directory configuration to your adonisrc.ts
file:
export default defineConfig({
// ... existing code ...
directories: {
jobs: 'app/jobs',
},
// ... existing code ...
})
This tells AdonisJS where to find your job files when using the node ace make:job
command.
Verify Installation
Create a test job to verify everything is working:
node ace make:job test
This should create a job file at app/jobs/test_job.ts
. If successful, you're ready to start using the package!
Next Steps
Now that you have the package installed, learn how to configure queues and workers for your application.