Closed itsTeknas closed 1 month ago
What lib do you use? Bull or BullMQ?
@felixmosh BullMQ "bullmq": "^5.7.5"
Ok, your setup looks OK. Try to check the "latest" tab, or any other. Can I debug it somehow?
Checking the Latest Tab with inspect element,
{
"queues": [
{
"name": "email-queue",
"statuses": [
"latest",
"active",
"waiting",
"waiting-children",
"prioritized",
"completed",
"failed",
"delayed",
"paused"
],
"counts": {
"active": 0,
"completed": 0,
"delayed": 0,
"failed": 0,
"paused": 0,
"prioritized": 0,
"waiting": 0,
"waiting-children": 0
},
"jobs": [],
"pagination": {
"pageCount": 1,
"range": {
"start": 0,
"end": 9
}
},
"readOnlyMode": true,
"allowRetries": false,
"allowCompletedRetries": false,
"isPaused": false
},
{
"name": "priority-email-queue",
"statuses": [
"latest",
"active",
"waiting",
"waiting-children",
"prioritized",
"completed",
"failed",
"delayed",
"paused"
],
"counts": {
"active": 0,
"completed": 2,
"delayed": 0,
"failed": 0,
"paused": 0,
"prioritized": 0,
"waiting": 0,
"waiting-children": 0
},
"jobs": [],
"pagination": {
"pageCount": 1,
"range": {
"start": 0,
"end": 9
}
},
"readOnlyMode": true,
"allowRetries": false,
"allowCompletedRetries": false,
"isPaused": false
},
...
]
}
The URL is public without any auth, you can check right now
@felixmosh
I have a gut feeling that the query parameters may not be parsing.
The response looks the same for the homepage /bullmq/api/queues?page=1&jobsPerPage=10
I'm using "express": "5.0.0-beta.3"
Middleware stack
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(express.static(path.join(__dirname, 'public')))
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'hbs')
Ha, ofcourse, we don't support express 5 yet, can you try to downgrade it to v4?
Yes, that worked!
But i really use some important express 5 features in my app like async (req,res)
with throw error in the middle and a global catcher.
I'm afraid, I can't downgrade my project.
Is there any guidance on making it compatible with express 5 ? Or a quick fix by adding some middleware etc ?
You were right, express 5 probably not parsing query string properly, just add a console.log in side the queue handler, and check what are the params that you get.
so i did this in express 5.x ,
router.use('/bullmq', (req,res,next) => {
console.log(req.query)
next()
})
router.use('/bullmq', BullMQStatus.getRouter())
[Object: null prototype] {
activeQueue: 'priority-email-queue',
status: 'latest',
page: '1',
jobsPerPage: '10'
}
when using app.set('query parser', 'simple')
{
activeQueue: 'priority-email-queue',
status: 'latest',
page: '1',
jobsPerPage: '10'
}
when using app.set('query parser', 'extended')
Neither of them showed the job details, As a side-node the rest of my app uses query strings and I never had a problem.
duplicate of #404
For future readers, The current workaround is adding a middleware before the express adapter.
// BullBoard Currently does not support express 5, so we need to manually set the query as a property on req
router.use('/bullmq', (req: Request, res: Response, next: NextFunction) => {
const query = req.query;
// Set query as a property on req instead of as a getter for backward
// compatibility with express 4
Object.defineProperty(req, 'query', { get: () => query });
next();
});
router.use('/bullmq', BullMQStatus.getRouter());
Job Details are not showing up
The list of jobs is working fine
The actual queue is functioning well also.
My Implementation
Dependencies:
Redis
Queue Definition
I'm not sure if my implementation is wrong or if this is a bug.