I'm planning on writing an RPC server in Java. The server needs to accept incoming RPCs - probably over HTTP - and answer them. Fairly basic stuff. Support for 'long polling' or 'hanging' RPCs isn't necessary, so a thread-per-request model ought to be perfectly adequate.
If I were writing this in Python, I would probably use a framework like twisted. In C, something like glibc. In each case, the framework provides an implementation of the general 'select loop' core of handling IO and invoking higher level constructs that deal with it, eventually leading to my application being called for events such as receiving an RPC.
It's a long time since I wrote anything substantial in Java, though, so I don't know what the state of the art or the suggested solutions are for this sort of thing. Possibly there's even parts of the standard library I can easily use to do this. Hence my question to StackOverflow: What frameworks are there out there that would be suitable for a task like this?
Note that although I may use HTTP for the RPCs, this is emphatically not a web application - and as such, a web framework is not appropriate.
Apache MINA is a very well designed asynchronous non-blocking networking framework. It provides byte-oriented access to read and write packet data. Building atop that it has a filter system where additional layers can be added, providing things like line-oriented text parsing, encryption (via TLS), compression, etc.
PS: The 2.0 release series is highly recommended, even though it's still in "milestone" form, it's proven very stable and is nearing a final release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With