arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
277 stars 129 forks source link

How to disable heartbeat? #175

Closed noorulcompro closed 6 years ago

noorulcompro commented 6 years ago

Hi,

We need to disable the heartbeat as suggested by CloudAMQ Support. Kindly suggest how can we do this? We are using the following versions of rabbot client and amqp server.

client: rabbot@1.1.0

Server: RabbitMQ@3.7.8 Erlang@20.1

Note: We are using CloudAMQ as SAAS.

Thanks.

carlhoerberg commented 6 years ago

When a heartbeat value of 0 is set, that should be sent to the server, not the server suggested value.

carlhoerberg commented 6 years ago

Here's the problem: https://github.com/squaremo/amqp.node/blob/6ee18f27e31863f5256bc921a21f36ebf2ba5e74/lib/connection.js#L192

You can close the issue here and open one in amqplib instead

noorulcompro commented 6 years ago

Thanx @carlhoerberg for the reply.

If you see the rabbot code at the line https://github.com/arobson/rabbot/blob/master/src/amqp/connection.js#L108

You will find that if we give heartbeat: 0 while making connection even though this library is sending the default value of the heartbeat.

carlhoerberg commented 6 years ago

https://github.com/squaremo/amqp.node/issues/467

noorulcompro commented 6 years ago

@carlhoerberg, Thanks for creating the issue.

But I think this rabbot library is too doing the same thing. When we set the hearbeat: 0, it sets the heartbeat to default i.e 30 seconds. This seems to be a bug. Please verify it.

Please check these links https://github.com/arobson/rabbot/blob/master/src/amqp/connection.js#L108

https://github.com/arobson/rabbot/blob/master/src/amqp/connection.js#L46

carlhoerberg commented 6 years ago

no, that seems fine. it sets it to 30s if you haven't specified heartbeats at all (i which case i would use the server's suggested value, but at least that's not hte problem here)

noorulcompro commented 6 years ago

Cool. Lets see if this squaremo/amqp.node#467 solves the problem.

On that note I'm closing this issue.

Thanx!