Open joelclouddistrict opened 1 year ago
I was just looking for this when considering how to stop my queue when hitting rate limits from third parties that it uses to process jobs, with the idea that I can keep track of usage and stop the consumer when I know I am approaching or will exceed rate limits. If anyone knows alternative solution to my problem would be interested in ideas.
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
Looking at bbc/sqs-consumer I can see the consumer.stop method, how can I retrieve the consumer to call the stop method?