You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Ted Ross <tr...@redhat.com> on 2009/03/17 21:22:17 UTC

client::Connection::registerFailureCallback

I want to use Connection::registerFailureCallback (in the client) to 
receive notification that my connection has been dropped.  I can find no 
use of this feature anywhere in the qpid c++ code.

My concern is that only one callback can be registered per connection.  
Subsequent registrations overwrite earlier ones.  Is this feature 
intended for a particular purpose or is it available for general use?  I 
don't want some future implementation to step on my callback (or vice 
versa).

Thanks,

-Ted


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: client::Connection::registerFailureCallback

Posted by michael goulish <mg...@redhat.com>.
Ted -- I put that function in -- I believe as part of my attempt some
time ago on session resume for "transparent failover" for cluster.

When we moved away from that approach, I think it got left behind.  

I can't remove it myself -- please feel free to make it do something
useful, or remove it from the code-base and recycle those bytes.

---------------------------------- Mick .



On Tue, 2009-03-17 at 16:22 -0400, Ted Ross wrote:
> I want to use Connection::registerFailureCallback (in the client) to 
> receive notification that my connection has been dropped.  I can find no 
> use of this feature anywhere in the qpid c++ code.
> 
> My concern is that only one callback can be registered per connection.  
> Subsequent registrations overwrite earlier ones.  Is this feature 
> intended for a particular purpose or is it available for general use?  I 
> don't want some future implementation to step on my callback (or vice 
> versa).
> 
> Thanks,
> 
> -Ted
> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: client::Connection::registerFailureCallback

Posted by Gordon Sim <gs...@redhat.com>.
Ted Ross wrote:
> I want to use Connection::registerFailureCallback (in the client) to 
> receive notification that my connection has been dropped.  I can find no 
> use of this feature anywhere in the qpid c++ code.
> 
> My concern is that only one callback can be registered per connection.  
> Subsequent registrations overwrite earlier ones.  Is this feature 
> intended for a particular purpose or is it available for general use?  I 
> don't want some future implementation to step on my callback (or vice 
> versa).

My personal recommendation would be to not use that callback.

If you have a SubscriptionManager running it will throw TransportFailure 
in the event that the connection is lost. (A call to any of the session 
methods will do likewise and if you are waiting on a Completion you will 
be woken up with the same exception thrown).

If the connection is closed due to an explicit error then you will get a 
ConnectionException subclass thrown.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org