[jboss-dev-forums] [Design of JBoss Remoting, Unified Invokers] - Callback acknowledgements

ron_sigal do-not-reply at jboss.com
Thu Sep 28 03:15:45 EDT 2006


Integrating the Remoting http transport into JBossMessaging has uncovered a requirement in Messaging for Remoting callbacks to generate acknowledgements, and we're soliciting comments on the nature of these acknowledgements.

Messaging will be using push callbacks, or, in the case of unidirectional transports (e.g., socket, http), "pseudo-push" or "poll" callbacks, in which an org.jboss.remoting.callback.CallbackPoller polls the server for callbacks and then pushes them to an InvokerCallbackHandler.  The CallbackPoller acts in place of the server side ServerInvokerCallbackHandler, which handles pure push callbacks. The requirement in Messaging is to get an acknowledgement when InvokerCallbackHandler.handleCallback() has returned.  This acknowledgement can be sent by CallbackPoller or ServerInvokerCallbackHandler in the cases of pseudo-push and push callbacks, respectively.

Beyond these requirements from Messaging, we're looking for the right set of acknowledgement concepts and the right set of API changes to implement them.  The main question is:  What does an acknowledgement mean?  Messaging needs an acknowledgement that indicates that the callback has been transferred to the client.  Now, it seems desirable for the implementation of a CallbackListener interface to be independent of how callbacks are configured, which raises the question of how pull callbacks should be acknowledged.  An acknowledgement sent just before Client.getCallbacks() returns would be an approximation to indicating that the callback has been passed to the client.  The advantage of sending acknowledgements from Client, CallbackPoller, and ServerInvokerCallbackHandler is that they are all handled inside of Remoting and require no application level action on the client side.

However, the pull callback acknowledgement is liable to spawn race conditions.  A stronger kind of acknowledgement would be for the application to call a new Client.acknowledgeCallback() method.  It requires an API change, but it seems to offer a more reliable and conclusive acknowledgement.  Moreover, this same form of acknowledgement would be available for push and poll callbacks as well.

One solution would be to have two levels of acknowledgements: Remoting and application.  Either or both could be requested by the CallbackListener.

Comments?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974771#3974771

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974771



More information about the jboss-dev-forums mailing list