Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Bullui #46 (#61)
Browse files Browse the repository at this point in the history
* setup bull board and controller

* add panel

* basic bull board enabled
  • Loading branch information
saraswatpuneet authored Sep 20, 2023
1 parent eff39ba commit e6ee015
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 4 deletions.
11 changes: 10 additions & 1 deletion apps/api/src/api.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Logger, Param, ParseFilePipeBuilder, Post, Put, UploadedFiles, UseInterceptors } from '@nestjs/common';
import { FilesInterceptor } from '@nestjs/platform-express';
import { ApiBody, ApiConsumes } from '@nestjs/swagger';
import { BullBoardInstance, InjectBullBoard } from '@bull-board/nestjs';
import { ApiService } from './api.service';
import {
AnnouncementResponseDto,
Expand All @@ -22,10 +23,18 @@ import {
export class ApiController {
private readonly logger: Logger;

constructor(private apiService: ApiService) {
constructor(
private apiService: ApiService,
@InjectBullBoard() private readonly bullBoard: BullBoardInstance,
) {
this.logger = new Logger(this.constructor.name);
}

@Get('bull-board')
async getBullBoard() {
return this.bullBoard;
}

// eslint-disable-next-line class-methods-use-this
@Get('health')
health() {
Expand Down
61 changes: 61 additions & 0 deletions apps/api/src/api.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { EventEmitterModule } from '@nestjs/event-emitter';
import { BullModule } from '@nestjs/bullmq';
import { ScheduleModule } from '@nestjs/schedule';
import { RedisModule } from '@liaoliaots/nestjs-redis';
import { BullBoardModule } from '@bull-board/nestjs';
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
import { ExpressAdapter } from '@bull-board/express';
import { ApiController } from './api.controller';
import { DevelopmentController } from './development.controller';
import { QueueConstants } from '../../../libs/common/src';
Expand All @@ -18,6 +21,10 @@ import { ConfigService } from '../../../libs/common/src/config/config.service';
enableOfflineQueue: false,
},
}),
BullBoardModule.forRoot({
route: '/queues',
adapter: ExpressAdapter,
}),
BullModule.registerQueue({
name: QueueConstants.REQUEST_QUEUE_NAME,
}),
Expand All @@ -42,6 +49,60 @@ import { ConfigService } from '../../../libs/common/src/config/config.service';
BullModule.registerQueue({
name: QueueConstants.PROFILE_QUEUE_NAME,
}),
BullModule.registerQueue({
name: QueueConstants.BATCH_QUEUE_NAME,
}),
BullModule.registerQueue({
name: QueueConstants.STATUS_QUEUE_NAME,
}),
BullModule.registerQueue({
name: QueueConstants.TRANSACTION_RECEIPT_QUEUE_NAME,
}),

BullBoardModule.forFeature({
name: QueueConstants.REQUEST_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.ASSET_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.BROADCAST_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.REPLY_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.REACTION_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.TOMBSTONE_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.UPDATE_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.PROFILE_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.BATCH_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.STATUS_QUEUE_NAME,
adapter: BullMQAdapter,
}),
BullBoardModule.forFeature({
name: QueueConstants.TRANSACTION_RECEIPT_QUEUE_NAME,
adapter: BullMQAdapter,
}),
ConfigModule,
RedisModule.forRootAsync(
{
Expand Down
Loading

0 comments on commit e6ee015

Please sign in to comment.