Queue Dashboard
The package includes integration with QueueDash, a web-based dashboard for monitoring and managing your BullMQ queues in real-time
Setup
Add the dashboard routes to your start/routes.ts
file:
import router from '@adonisjs/core/services/router'
import { queueDashUiRoutes } from '@nemoventures/adonis-jobs/ui/queuedash'
// Add queue dashboard routes
router.group(() => {
queueDashUiRoutes().prefix('/queue')
}).prefix('/admin')
This will make the dashboard available at /admin/queue
. Run your AdonisJS application and open http://localhost:3333/admin/queue
to access the dashboard.
Custom Authentication
Since these routes are standard AdonisJS routes, you can protect them using a authentication middleware.
import { middleware } from '#start/kernel'
router.group(() => {
queueDashUiRoutes().prefix('/queue')
})
.prefix('/admin')
.use(middleware.auth({ guards: ['basicAuth'] }))
Shield Configuration
To enable job deletion and re-running directly from the dashboard, make sure to exclude the dashboard routes from CSRF protection in your config/shield.ts
file. Exempt all routes starting with /admin/queue
under the csrf option:
csrf: {
enabled: true,
exceptRoutes: (ctx) => {
return ctx.request.url().startsWith('/admin/queue')
},
},
Next Steps
Learn about monitoring and metrics to set up comprehensive observability for your job queues.