Closed ivanmaximenko closed 3 weeks ago
This is not nestjs-packages/sqs That's a different library.
I think what the OP meant is that by starting listening on onModuleInit
, it is hard to wait on other dependencies that the consumer code may need, because in the NestJS lifecycle, this will only wait on child & providers' onModuleInit
If nestjs-sqs
was to start listening with onApplicationBootstrap
then all other onModuleInit
would have happened, and it's not clear why nestjs-sqs
would need to listen & process as early as onModuleInit
We had an issue when not all modules are initialized and application starts receiving messages, does it make sense to start consuming messages in onApplicationBootstrap stage as here for example https://github.com/nestjs-packages/sqs/blob/master/lib/sqs.service.ts#L20