Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AnteaterKit/e53bfe80bf9c7a5abe36bf484c34b96a to your computer and use it in GitHub Desktop.
Save AnteaterKit/e53bfe80bf9c7a5abe36bf484c34b96a to your computer and use it in GitHub Desktop.
mq
imports
HttpModule
BullModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => {
const connection = configService.get('redisconnection');
return {
connection: connection,
}
},
inject: [ConfigService],
}),
BullModule.registerQueue({
name: Queues.,
}),
BullBoardModule.forRoot({
route: '/queues',
adapter: ExpressAdapter // Or FastifyAdapter from `@bull-board/fastify`
}),
BullBoardModule.forFeature({
name: Queues,
adapter: BullMQAdapter, //or use BullAdapter if you're using bull instead of bullMQ
}),
providers
{
provide: Consumer,
useFactory: (configService: ConfigService, pm: ManagerService) => {
const mqEnabled = configService.get('mqEnabled');
return mqEnabled ? new Consumer(pm, configService) : null;
},
inject: [ConfigService, ProxyManagerService],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment