[Design of JBoss Remoting, Unified Invokers] - Re: remoting streams
by david.lloyd@jboss.com
"jahlborn" wrote : the choice made in the remoting impls leads to some performance consequences. every remote retrieval operation for inputstream requires two remote calls (hasNext and next). additionally, for the collection based impls (IteratorObjectSource), every object retrieval requires two remote calls!
Ah, but the secret here is that you don't make a network round-trip for each method call. Every time an item or a batch of items is sent, an indicator can easily be added to signify that there are more items (or not). This is because each stream handler has its own wire implementation. So it's actually more efficient than RPC-style invocations (in the spirit of Remoting 3 in general, which seeks to move away from the RPC style).
Not only does this mean that you don't make the extra remote request for "hasNext", but you can actually have higher throughput overall since the stream handler can forward multiple objects at one time rather than making a round trip for each one.
"jahlborn" wrote : the other big thing that stuck out to me is the lack of any idempotent guarantees. it's possible this is provided by the underlying framework, but, if not, it's a significant weakness.
Yes, the idea is that reliability is provided by the framework, and the user need not worry about it. If a request fails irreparably, a RemotingException is thrown.
"jahlborn" wrote : another problem that's more related to remoting as a whole (at least in previous remoting versions), is the lack of an interface similar to java.rmi.server.Unreferenced. this becomes more important for things like streams which can be holding system resources which are relatively scarce (open file handles, database connections, etc). it's not uncommon for a client to die unexpectedly before the "close" method is invoked on the server. this will leave the stream resource open indefinitely.
This is up to the individual stream handlers, however for the default stream handlers the close() method will be called when the remote side either (a) closes the stream explicitly or (b) lets it die unreferenced while still open. It is possible that there is a use case to handle these situations differently, but so far I know of no such case.
"jahlborn" wrote : one last minor point is that i see no support for duplicate close calls (again, this could be managed elsewhere by the underlying framework).
Every usage of close() uses the java.io.Closeable interface, which specifies that "If the stream is already closed then invoking this method has no effect". I do intend to keep those semantics.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102333#4102333
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102333
18 years, 5 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: New wireformat and client side remoting
by timfox
"jmesnil" wrote : "timfox" wrote : More thoughts, how this might look:
| |
| | abstract class Packet
| | {
| | long correlationID;
| | }
| |
| | interface Dispatcher
| | {
| | Handler registerHandler(int handlerID);
| |
| | void sendOneWay(Packet packet, int handlerID);
| |
| | void sendBlocking(Packet packet, int handlerID);
| | }
| |
| | interface Handler
| | {
| | void handle(Message message);
| | }
| |
|
| I have a simple prototype which is quite similar:
|
|
| | interface Packet
| | {
| | long correlationID;
| | String handlerID;
| | }
| |
| | class CreateSessionRequest extends Packet {
| | }
| | class CreateSessionResponse extends Packet {
| | }
| |
| | interface Client
| | {
| | Handler registerHandler(int handlerID, Handler handler);
| | void unregisterHandler(int handlerID);
| |
| | void sendOneWay(Packet packet);
| |
| | Packet sendBlocking(Packet packet);
| | }
| |
| | interface Handler
| | {
| | void handle(Packet packet);
| | }
| |
|
Sounds pretty much right to me :)
You could probably just use the current Dispatcher and change it to implement the new Dispatcher interface.
You could also re-use the current requests and reponses (of course some won't be appropriate any more) - these are the packets.
You would need to change the serverInvoker method of course to instead call back into the Dispatcher, so the Dispatcher can notify the correct handlers.
A couple more things to think about:
1) How does the user configure the new transport?
The user needs to be able to choose from:
a) socket
b) ssl
c) http
each will have its own set of parameters
some config is appropriate for the server side and some for the client. e.g. thread pool sizes and MINA threading model.
2) We need some kind of "heartbeat" functionality. I.e. periodically sending ping messages on the connection, so the server knows if the client is still alive, and the client knows if the connection is still alive.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102327#4102327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102327
18 years, 5 months
[Design the new POJO MicroContainer] - Re: Failing FileVFSUnitTestCase.testVFSFileURIFactory in VFS
by alesj
"alesj" wrote : "scott.stark(a)jboss.org" wrote : What delete fails? I can't see how the testFileExists delete should fail.
| If you run this test case on Winz, the file is not deleted, so File.delete (tmp.delete()) doesn't return true.
|
Since, similar to URLExistsUnitTestCase, looks like something is again holding the resources.
| 3500 DEBUG [FileVFSUnitTestCase] ==== Starting testFileExists ====
| 3500 INFO [FileVFSUnitTestCase] +++ testFileExists, tmp=C:\tmp\vfs\vfs33660.root\testFileExists33661.tmp
| 3500 DEBUG [FileVFSUnitTestCase] testFileExists took 0ms
| 3500 DEBUG [FileVFSUnitTestCase] ==== Stopping testFileExists ====
|
| junit.framework.AssertionFailedError: tmp.delete()
| at org.jboss.test.virtual.test.FileVFSUnitTestCase.testFileExists(FileVFSUnitTestCase.java:1287)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102324#4102324
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102324
18 years, 5 months