nestjs icon indicating copy to clipboard operation
nestjs copied to clipboard

Nest js fails to run when RabbitMq is not reachable and the service is using @RabbitSubscribe or @RabbitRPC for listening a queue.

Open vijaycenation14 opened this issue 3 years ago • 4 comments

vijaycenation14 avatar Aug 10 '22 17:08 vijaycenation14

https://github.com/golevelup/nestjs/blob/241a64075e06e15d273994ae786e7d0acec09c31/packages/rabbitmq/src/amqp/connection.ts#L340

Issue is in this function. Have to handle the failure scenario.

I.e, When addSetup fails, function doesn't call the callback instead it returns undefined.

vijaycenation14 avatar Aug 10 '22 17:08 vijaycenation14

Raised a PR also

https://github.com/golevelup/nestjs/pull/495

vijay94 avatar Aug 11 '22 10:08 vijay94

@WonderPanda

vijay94 avatar Aug 16 '22 12:08 vijay94

I have experienced the same issue. When a connection to the RabbitMQ broker cannot be established, the NestJS application fails to start, even with { connectionInitOptions: { wait: false } }. However, after I applied the patch suggested in #495 locally the application started successfully. I would like to begin using this package very soon, so if there is any way that the pull request can get reviewed and merged quickly, I would greatly appreciate it.

davidtemplin avatar Sep 08 '22 18:09 davidtemplin

@WonderPanda The fix was made only to RabbitSubscribe and not been done to RabbitRPC. Can Raise a merge request for the same?

vijay94 avatar Sep 27 '22 11:09 vijay94

Sure, feel free to provide the fix and I will merge and publish a new package version

On Tue., Sep. 27, 2022, 7:48 a.m. vijay sundharapandiyan, < @.***> wrote:

@WonderPanda https://github.com/WonderPanda The fix was made only to RabbitSubscribe and not been done to RabbitRPC. Can Raise a merge request for the same?

— Reply to this email directly, view it on GitHub https://github.com/golevelup/nestjs/issues/494#issuecomment-1259385888, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3WVG5OV35CZJGXBCGCOWTWALNJXANCNFSM56FL5VDQ . You are receiving this because you were mentioned.Message ID: @.***>

WonderPanda avatar Sep 27 '22 12:09 WonderPanda