From: <ovi...@jb...> - 2005-05-04 01:02:42
|
The central issue seem to revolve around the statement: The server threads should not be blocked on communication or slow/unreliable clients With the current design, the server-side Consumer endpoint synchronously calls into its corresponding client-side remoting callback handler, every time a new message is pushed to it by the core. If we want asynchronous delivery on the client (i.e. the message gets as soon as possible on the client, without polling), I don't think there is a way around that: the server thread will block calling callbackHandler.handleCallback(...) until something happens. That something could be: 1. a negative acknowledgement - the client says that nobody wants that message 2. a positive acknowledgment - the client says that it's got the message and now the client endpoint can acknowlege the message to the core. 3. an unchecked exception generated by a broken client 4. a communication error of some sort, that bubbles out of remoting The case 1 is detected immediately: there is no tread blocked in waiting on receive() or there is no message listener. The negative acknoweldgement can be generated pretty quickly in this case, and with no client code involvement. For the case 2, the situation is a little bit more complicated. 2.1 If there is client thread blocked in MessageConsumer.receive(), the callback handler will just hand over the message (my solution for this is to use a RendezVous object) and this is the positive acknowledgment. The client-side remoting thread will just unwind and the server will immediately get the positive acknowledgment. 2.2 However, if there is a message listener, the current implementation uses the remoting thread to invoke onMessage(). This can be a problem, since I have no control over how long onMessage() will take. I can think at several solutions, to have a separate thead that invokes onMessage(), for example. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876361#3876361 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876361 |