I'm build a couple of services which I need them to remotely access each others methods. I'm currently using Spring`s RmiServiceExporter but I wonder if there's a framework which does not depends on the java classes, serial number, etc. In other words, I don't want to share java code/classes between the servies.
5 Answers
Your options include:
- SOAP Web Services
- XML-RPC
- Apache Thrift
- Protocol Buffers (see also this question)
- Apache Avro
- RESTful Web services
REST, in particular, isn't really RPC; it requires a different style of thinking, where you focus on defining a rich set of resources (nouns) rather than a rich set of methods (verbs).
The others can provide more traditional RPC, but with less tight coupling to Java, and so are programming-language independent.
In SOAP you can write the interface in WSDL, or generate it from annotated Java classes.
In Thrift, you write the interface in the Thrift IDL, and generate Java classes from that.
With RMI you will always be commited to Java Classes. May I suggest you taking a look at RESTful web-service approach?

- 1,083
- 12
- 25
You could check out Spring's HttpInvoker. Or the Hessian and Burlap supported with Spring remoting. See http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html

- 20,219
- 3
- 44
- 65
Protocol Buffers is a good way to avoid serialization/versioninig issues and remain language agnostic.

- 775
- 1
- 8
- 17
Another option is Versile Java (I am one of the developers). It is in development but already quite stable so you may want to try out if the GNU Affero GPL license works for your project.
Versile Java handles object-level interaction. Exposing objects and methods is straight-forward by inheriting the appropriate base class and using annotations. Below is a simple example class.
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.

- 308
- 1
- 4
-
@Mikhas Hope it fits your needs; feel free to use our [forum](https://versile.com/forum/) if you have any questions – Versile Feb 28 '12 at 12:34