RMI sucked for me, so I wrote my own RMI

Using the transparent remoting feature of springframework was a joy. It’s merely one generic remote invokation RMI-Stub which is called by a client side dynamic proxy. So extending my silver-bullet application to connect to a RMI server was easy.
But then, there began the trouble with our firewall…

My RMI-Server is hidden behind our coporate firewall, so I built a tunnel through it. But this didn’t work out, because the RMI client wanted to open connections to the server on abitrary ports. I digged through Sun’s RMI-Tutorial and decided that it should be possible. However I had no luck. I tried “rmibc” from css associates which did me let go further, but after 2 hours of digging through their code and after reading tens of megs of network traffic dumpI gave up again.

Trying hessian from caucho was easy, but no luck for me because it uses a custom serialization protocol which didn’t fit me needs.

I needed no callback in my application and I was in a hurry to present the application to our clients, so I wrote my own kind of RMI. A litte client proxy which serializes the name of the service called, the method and the parameters, then a little server which reads the invocation, executes it on the server using reflection and sends back the result over the wire. Nice!

It was actually done in 30 min. I’d wish I had done it like this way before :-)


{ Comments are closed! }