ssut / nestjs-sqs

A project to make SQS easier to use within NestJS, with decorator-based handling and seamless NestJS-way integration.
MIT License
204 stars 54 forks source link

Application is not ready to consume messages #74

Closed ivanmaximenko closed 3 weeks ago

ivanmaximenko commented 8 months ago

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

saket-anand commented 6 months ago

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

max-mathieu commented 1 month ago

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