nestjs-sqs icon indicating copy to clipboard operation
nestjs-sqs copied to clipboard

Application is not ready to consume messages

Open ivanmaximenko opened this issue 1 year ago • 1 comments

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

ivanmaximenko avatar Jan 12 '24 10:01 ivanmaximenko

This is not nestjs-packages/sqs That's a different library.

saket-anand avatar Mar 23 '24 05:03 saket-anand

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

max-mathieu avatar Sep 04 '24 13:09 max-mathieu