bee-queue / docker-arena

The official docker application for bee-queue arena.
17 stars 15 forks source link

Provide an example index.json file #209

Open olliechick opened 3 years ago

olliechick commented 3 years ago

There is no example index.json file, so it is not clear what should go in it.

With my current index.json, I get the error:

UnhandledPromiseRejectionWarning: TypeError: BullMQ is not a constructor
    at Queues.get (/opt/arena/node_modules/bull-arena/src/server/queue/index.js:102:15)
    ...
bitops commented 3 years ago

@olliechick the options are documented here: https://github.com/bee-queue/arena/#usage

olliechick commented 3 years ago

My index.json looks like this:

{
  "queues": [
    {
      "type": "bullmq",
      "name": "REDACTED1",
      "hostId": "REDACTED2",
      "redis": {
        "host": "REDACTED3",
        "port": 6379,
        "password": "REDACTED4"
      }
    }
  ],
  "flows": [
    {
      "type": "bullmq",
      "name": "REDACTED1",
      "hostId": "REDACTED2",
      "redis": {
        "host": "REDACTED3",
        "port": 6379,
        "password": "REDACTED4"
      }
    }
  ]
}

It doesn't have the queueing library that is documented in the link you provided - how would I import that?

bitops commented 3 years ago

@olliechick did you try:

{
  Bull,
  "queues": [
    {
      "type": "bullmq",
      "name": "REDACTED1",
      "hostId": "REDACTED2",
      "redis": {
        "host": "REDACTED3",
        "port": 6379,
        "password": "REDACTED4"
      }
    }
  ],
  "flows": [
    {
      "type": "bullmq",
      "name": "REDACTED1",
      "hostId": "REDACTED2",
      "redis": {
        "host": "REDACTED3",
        "port": 6379,
        "password": "REDACTED4"
      }
    }
  ]
}
spiffytech commented 2 years ago

I get the same error with BullMQ. The above example isn't valid JSON, it's JS (and produces a JSON parse error if I try using it anyway).

The problem is that docker-arena expects require('bullmq') to return a constructor, but it instead returns a bunch of different classes. I modified that line in index.js to read:

return BullMQ || (BullMQ = require('bullmq').Queue);

and I've got docker-arena working.