-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hello,
I'm trying to figure out how to stop consumers manually. I want to handle the onApplicationShutdown
NestJS lifecycle hook and, when it is called, stop the SQS consumer and check that there are no jobs running.
This is the SqsModuleOptionsFactory
@Injectable()
export default class SqsOptionsFactory implements SqsModuleOptionsFactory {
createOptions(): SqsOptions | Promise<SqsOptions> {
const consumers = []
consumers.push({
name: "the-queue-name",
queueUrl: "the-queue-url",
region: "the-queue-region",
})
return { consumers, producers: [] }
}
}
Looking at bbc/sqs-consumer I can see the consumer.stop method, how can I retrieve the consumer to call the stop method?
Benno007, schm-dt and hugoblanc
Metadata
Metadata
Assignees
Labels
No labels