Giter Site home page Giter Site logo

Comments (5)

alanxz avatar alanxz commented on July 28, 2024

Unfortunately the rabbitmq-c library which the SimpleAmqpClient wraps while
it has the ability to send and receive heartbeat frames, does not have the
infrastructure to support detecting and sending heartbeat frames. While it
would be possible to enable these in SimpleAmqpClient it would require
quite a bit of refactoring to do.

If you feel inclined I would encourage you to develop a patch and submit it
to either rabbitmq-c or SimpleAmqpClient.

On Saturday, August 25, 2012, myheimu wrote:

I use RabbitMQ in a unreliable network. So, the clients may lose
connection with the server sometimes.
I think the "heartbeat" defined in amqp_login could help me.
Could I just modify the #define BROKER_HEARTBEAT in Channel.cpp?
Or I need to modify more source files?


Reply to this email directly or view it on GitHubhttps://github.com//issues/20.

from simpleamqpclient.

fransslabber avatar fransslabber commented on July 28, 2024

Hi Alan, although this issue is closed I face a similar problem. Any update on a heartbeat patch? Otherwise I'll give it a go.

Thanks
Frans

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

There have been no updates on a patch that I know about. Feel free to give it a shot.

from simpleamqpclient.

cmoesel avatar cmoesel commented on July 28, 2024

Hello! With recently improved support for heartbeats in rabbitmq-c, I wonder if there is any movement toward more official support in SimpleAmqpClient? We've found the #define BROKER_HEARTBEAT 0 in ChannelImpl.cpp-- and discovered that if we change it to a non-zero value, it seems to be mostly working (as far as we can tell).

Is it indeed working? If so, are you planning a version that doesn't require us to modify the source to enable it? If it is not fully working, what are the issues that still need to be addressed?

Thanks!

from simpleamqpclient.

alanxz avatar alanxz commented on July 28, 2024

Support for AMQP heartbeats in rabbitmq-c is still what I would consider partial. What I mean by that is: the library will only correctly service AMQP heartbeats when client code calls blocking calls into the library (e.g., amqp_simple_wait_frame, amqp_basic_publish). If the client code is off doing other things, heartbeats will not be serviced, and its possible if there's enough of a delay between calls into rabbitmq-c, the broker will incorrectly consider the connection broken and close it.

So simply adding an overload to Channel::Create() that took a heartbeat parameter would give the same level of support to SimpleAmqpClient.

The reason I haven't already done has to do with the philosophy behind SimpleAmqpClient; which was to make a client that worked consistently no matter how client used it. So if I were to add heartbeat support to SimpleAmqpClient I would want to add it in such a way that the above caveat didn't apply. I think this means that there would need to be a thread associated with each AmqpClient::Channel object that took care to make sure that rabbitmq-c was being used in such a way that heartbeats were being serviced. Unfortunately due to the design of rabbitmq-c this isn't trivial.

So I guess a bottom line on this is: if you really want support for heartbeats in SimpleAmqpClient, I would be willing to accept a patch that does the trivial thing to get heartbeats working (and has a warning in the API docs indicating what heartbeat support really means). I would prefer a solution that works in all cases, but I don't currently have plans to work on this.

from simpleamqpclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.