-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heartbeat for RMQ socket options not working as expected #5788
Comments
It looks like the code calling amqp-connection-manager is passing over the options incorrectly: The Nest RMQ Factory is passing over the entire options object as ` options.reconnectTimeInSeconds options.findServers(callback) options.connectionOptions |
Thanks for reporting! Lets track this here #5790 |
In the latest versions of the Issue in code: The problem can be traced to this section of the |
all other properties, beside 'connectionOptions', from the socketOptions object ( of type AmqpConnectionManagerSocketOptions ) were being discarded on the creation of the AmqpConnectionManager client https://github.com/nestjs/nest/blob/master/packages/microservices/external/rmq-url.interface.ts#L47 https://github.com/jwalton/node-amqp-connection-manager/blob/v4.1.14/src/AmqpConnectionManager.ts#L46 nestjs#5788 (comment)
@arturgrigor I've added a possible fix that would include the discarded options https://github.com/nestjs/nest/pull/14059/files |
Bug Report
Current behavior
When configuring a Rmq Microservice. using the documentation on the website: https://docs.nestjs.com/microservices/rabbitmq
It suggests that the socket options being used are those in the amqlib library, however. Upon inspecting the NestJS microservice factory it appears to be using the amqp-connection-manager library. Which has a different socketOptions footprint.
https://github.com/nestjs/nest/blob/master/packages/microservices/server/server-rmq.ts#L54
the socket options footprint is described here: https://www.npmjs.com/package/amqp-connection-manager#user-content-amqpconnectionmanagercreatechanneloptions
The documentation that is listed on nestJS says you should us
heartbeat:60
per the documents in amqlib however teh amqp-connection-manager says to useheartbeatIntervalInSeconds: 60
Also, it would appear that neither heartbeat or heartbeatIntervalInSeconds actually has an effect on the heartbeat setting from what i can see.
The only way i was able to get the heartbeat to work as expected was to pass in the url as a object config instead as suggested by this PR: #5587
Input Code
Expected behavior
amqplib
, oramqp-connection-manager
options are being respected properly when usingconnectMicroservice
Possible Solution
Update the documenation.
I am going to see if i can get the heartbeat config to work properly using what i see in the live code today:
amqp-connection-manager
Environment
The text was updated successfully, but these errors were encountered: