[openamq-dev] Disconnect notification between two peers
Mike Owens
mikeowens at gmail.com
Wed Nov 7 15:10:36 CET 2007
Thanks for your reply. (2) is more than sufficient for my needs. Client's
crashing or going off-line is the exception, not the rule, so a ping every
now and then should be enough the address the situation if and when it
happens.
-- Mike
On Nov 7, 2007 3:14 AM, Martin Lucina <mato at imatix.com> wrote:
> Mike,
>
> mikeowens at gmail.com said:
> > I hope I am not coming across as demanding. I am just trying to find the
> best
> > way for me to solve this problem. If I have to implement a ping/timeout
> on the
> > server, that's fine. It's easy to do with AMQ. I just want to make sure
> up
> > front that I am taking the best approach possible. That is why I am
> asking.
>
> There's no way to do what you're asking in the protocol. You have three
> options:
>
> 1) Have the service publish it's replies to the client with the
> mandatory and immediate flags set to 1. You'll get a basic.return
> back from OpenAMQ if the client is no longer there.
>
> 2) Have the service regularly publish a 'ping' message (with mandatory and
> immediate set to 1) to the client. If the client goes away, you'll
> get a basic.return back. The client can just ignore the 'ping'
> messages.
>
> 3) As for 2), but have the client actually send a 'pong' back if it
> receives a 'ping' from the service.
>
> 1) is good enough if you don't need to know quickly that the client went
> away, only the next time you try to talk to it.
>
> The difference between 2) and 3) is that 3) handles the case where the
> client is connected to OpenAMQ but the application has gone off into
> la-la land.
>
> In your case (Apache-style worker pool of services) you probably want 2)
> but might want 3) if you want to be extra sure that the client is
> actually alive and kicking.
>
> As for doing it via the console API/working out some other notification
> mechanism, Pieter would be the best person to answer that question.
>
> -mato
>
> _______________________________________________
> openamq-dev mailing list
> openamq-dev at lists.openamq.org
> http://lists.openamq.org/mailman/listinfo/openamq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openamq.org/pipermail/openamq-dev/attachments/20071107/0ce09981/attachment.htm
More information about the openamq-dev
mailing list