RPC Framework for Java

I am creating a couple of services that I need for remote access to each other. I am currently using RmiServiceExporter Spring, but I am wondering if there is an infrastructure that does not depend on java classes, serial number, etc. In other words, I do not want to share Java code / classes between services.

+4
source share
5 answers

Your options include:

REST, in particular, is not RPC; it requires a different thinking style, where you focus on defining a rich set of resources (nouns), rather than a rich set of methods (verbs).

Others may provide a more traditional RPC, but with less tight connection with Java, and therefore independent of the programming language.

In SOAP, you can write an interface in WSDL or generate it from annotated Java classes.

In Thrift, you write an interface in the Thrift IDL and generate Java classes from this.

+5
source

With RMI, you will always be tied to Java classes. May I suggest you take a look at the RESTful web service approach?

+1
source

You can check out Spring HttpInvoker. Or Hessian and Burlap are supported using Spring remote objects. See http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html

0
source

Protocol buffers are a good way to avoid serialization / version problems and remain agnostic of the language.

0
source

Another option is Versile Java (I am one of the developers). It is under development, but is already stable enough, so you can try it if the GNU Affero GPL license works for your project.

Versile Java handles object-level interaction. Objects and methods are exposed in a straightforward manner, inheriting the corresponding base class and using annotations. The following is a simple example.

import org.versile.orb.external.*; @Doc(doc="Provides an echo service") public class Echoer extends VExternal { @Publish(show=true, ctx=false) @Doc(doc="Echo service, returns the provided argument.") public Object echo(Object obj) { return obj; } } 

As a bonus, you can also use it to interact with Versile Python clients or services.

0
source

Source: https://habr.com/ru/post/1398691/


All Articles