Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An interactive UI dashboard for Bee, Bull and BullMQ packages

License

NotificationsYou must be signed in to change notification settings

bee-queue/arena

Repository files navigation

NPMcode style: prettierNPM downloadssemantic-release

An intuitive Web GUI forBee Queue,Bull andBullMQ. Built on Express so you can run Arena standalone, or mounted in another app as middleware.

For a quick introduction to the motivations for creating Arena, readInteractively monitoring Bull, a Redis-backed job queue for Node.

Screenshots

Features

  • Check the health of a queue and its jobs at a glance
  • Paginate and filter jobs by their state
  • View details and stacktraces of jobs with permalinks
  • Restart and retry jobs with one click

Usage

Arena accepts the following options:

constArena=require('bull-arena');// Mandatory import of queue library.constBee=require('bee-queue');Arena({// All queue libraries used must be explicitly imported and included.  Bee,// Provide a `Bull` option when using bull, similar to the `Bee` option above.queues:[{// Required for each queue definition.name:'name_of_my_queue',// User-readable display name for the host. Required.hostId:'Queue Server 1',// Queue type (Bull or Bee - default Bull).type:'bee',// Queue key prefix. Defaults to "bq" for Bee and "bull" for Bull.prefix:'foo',},],// Optionally include your own stylesheetcustomCssPath:'https://example.com/custom-arena-styles.css',// Optionally include your own scriptcustomJsPath:'https://example.com/custom-arena-js.js',});

The requiredname andhostId in each queue object have to be present in each queue object. Additional keys can be present in them, to configure the redis client itself.

The three ways in which you can configure the client are:

1. port/host

// In a queue object.{// Hostname or IP. Required."host":"127.0.0.1",// Bound port. Optional, default: 6379."port":6379,// Optional, to issue a redis AUTH command."password":"hello",// Optional; default 0. Most of the time, you'll leave this absent."db":1}

2. URL

You can also provide aurl field instead ofhost,port,db andpassword.

{"url":"[redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]"}

3. Redis client options

Arena is compatible with both Bee and Bull.If you need to pass some specific configuration options directly to the redis client library your queue uses, you can also do so.

Bee uses noderedis client, Bull usesioredis client.These clients expect different configurations options.

{"redis":{}}

For Bee, theredis key will be directly passed toredis.createClient, as explainedhere.

For Bull, theredis key will be directly passed toioredis, as explainedhere. To use this to connect to a Sentinel cluster, seehere.

Custom configuration file

To specify a custom configuration file location, seeRunning Arena as a node module.

Note that if you happen to use Amazon Web Services' ElastiCache as your Redis host, check outhttp://mixmax.com/blog/bull-queue-aws-autodiscovery

Running Arena as a node module

See theDocker image section or thedocker-arena repository for information about running this standalone.

Note that because Arena is implemented usingasync/await, Arena only currently supports Node>=7.6.

Using Arena as a node module has potential benefits:

  • Arena can be configured to use any method of server/queue configuration desired
    • for example, fetching available redis queues from an AWS instance on server start
    • or even just plain old reading from environment variables
  • Arena can be mounted in other express apps as middleware

Usage:

In project folder:

$ npm install bull-arena

In router.js:

constArena=require('bull-arena');constexpress=require('express');constrouter=express.Router();constarena=Arena({// Include a reference to the bee-queue or bull libraries, depending on the library being used.queues:[{// First queue configuration},{// Second queue configuration},{// And so on...},],});router.use('/',arena);

Arena takes two arguments. The first,config, is a plain object containing thequeue configuration, flow configuration (just for bullmq for now) and other optional parameters. The second,listenOpts, is an object that can contain the following optional parameters:

  • port - specify custom port to listen on (default: 4567)
  • host - specify custom ip to listen on (default: '0.0.0.0')
  • basePath - specify custom path to mount server on (default: '/')
  • disableListen - don't let the server listen (useful when mounting Arena as a sub-app of another Express app) (default: false)
  • useCdn - set false to use the bundled js and css files (default: true)
  • customCssPath - an URL to an external stylesheet (default: null)
Example config (for bull)
importArenafrom'bull-arena';importBullfrom'bull';constarenaConfig=Arena({  Bull,queues:[{type:'bull',// Name of the bull queue, this name must match up exactly with what you've defined in bull.name:"Notification_Emailer",// Hostname or queue prefix, you can put whatever you want.hostId:"MyAwesomeQueues",// Redis auth.redis:{port:/* Your redis port */,host:/* Your redis host domain*/,password:/* Your redis password */,},},],// Optionally include your own stylesheetcustomCssPath:'https://example.com/custom-arena-styles.css',// Optionally include your own scriptcustomJsPath:'https://example.com/custom-arena-js.js',},{// Make the arena dashboard become available at {my-site.com}/arena.basePath:'/arena',// Let express handle the listening.disableListen:true,});// Make arena's resources (js/css deps) available at the base app routeapp.use('/',arenaConfig);

(Credit totim-soft for the example config.)

Example config (for bullmq)
importArenafrom'bull-arena';import{Queue,FlowProducer}from"bullmq";constarenaConfig=Arena({BullMQ:Queue,FlowBullMQ:FlowProducer,queues:[{type:'bullmq',// Name of the bullmq queue, this name must match up exactly with what you've defined in bullmq.name:"testQueue",// Hostname or queue prefix, you can put whatever you want.hostId:"worker",// Redis auth.redis:{port:/* Your redis port */,host:/* Your redis host domain*/,password:/* Your redis password */,},},],flows:[{type:'bullmq',// Name of the bullmq flow connection, this name helps to identify different connections.name:"testConnection",// Hostname, you can put whatever you want.hostId:"Flow",// Redis auth.redis:{port:/* Your redis port */,host:/* Your redis host domain*/,password:/* Your redis password */,},},],// Optionally include your own stylesheetcustomCssPath:'https://example.com/custom-arena-styles.css',// Optionally include your own scriptcustomJsPath:'https://example.com/custom-arena-js.js',},{// Make the arena dashboard become available at {my-site.com}/arena.basePath:'/arena',// Let express handle the listening.disableListen:true,});// Make arena's resources (js/css deps) available at the base app routeapp.use('/',arenaConfig);

Bee Queue support

Arena is dual-compatible with Bull 3.x and Bee-Queue 1.x. To add a Bee queue to the Arena dashboard, include thetype: 'bee' property with an individual queue's configuration object.

BullMQ Queue support

Arena has added preliminary support for BullMQ post 3.4.x version. To add a BullMQ queue to the Arena dashboard, include thetype: 'bullmq' property with an individual queue's configuration object.

Docker image

You candocker pull Arena fromDocker Hub.

Please see thedocker-arena repository for details.

Official UIs

Contributing

Seecontributing guidelines andan example.

License

TheMIT License.


[8]ページ先頭

©2009-2025 Movatter.jp