Framework for Java RPC Server

I am planning on writing an RPC server in Java. The server should accept incoming RPCs - possibly through HTTP - and respond to them. Simple enough material. Support for "long polls" or "freezing" RPCs is not required, therefore, a model with a stream per request should be quite adequate.

If I wrote this in Python, I would probably use a framework like twisted. In C, something like glibc. In each case, the infrastructure provides the implementation of the main core of the β€œselect loop” IO processing and the call of higher-level constructions that are associated with it, which ultimately leads to the fact that my application is called for events such as receiving RPC.

For a long time I wrote something significant in Java, so I don’t know what a modern solution or proposed solutions for these kinds of things are. Perhaps there are even parts of the standard library that I can easily use for this. So my question is to StackOverflow: what framework is there that is suitable for such a task?

Please note that although I can use HTTP for RPC, this is not a web application, and therefore the web framework is not suitable.

+4
source share
3 answers

Apache MINA is a very well-developed asynchronous non-blocking network infrastructure. It provides byte-oriented access to read and write packet data. Building on the fact that it has a filter system into which additional layers can be added that provide such things as linear text analysis, encryption (via TLS), compression, etc.

PS: The 2.0 release series is highly recommended, although it is still in milestone form, it has proven to be very stable and is approaching the final version.

+4
source

You could use some things as easy as Jetty's berth insides are very stable and can handle pretty dumb numbers of connections. If you implement a specific Jetty handler interface, you can also use all the servlet and JSP support libraries, which makes it a fairly small built-in server applications.

+3
source

You have several options:

  • Build your own solution with an existing socket programming SDK.
  • Java RMI, remote method invocation framework.
  • Java CORBA bindings are no longer considered current.
  • The framework of Java web services is quite complex. Take a look at Apache CXF and various J2EE products.

Then you have different systems working on HTTP transport, such as JSON / XML-RPC, where you need a web server. Even if you exclude them.

+2
source

All Articles