Re: What is the difference between JMS, SOAP and RMI ?

From: Will Hartung (willh_at_msoft.com)
Date: 10/05/04


Date: Tue, 5 Oct 2004 14:02:50 -0700


"Anan H. Samiti" <anan22@hotmail.com> wrote in message
news:cjuqk3$e06$04$1@news.t-online.com...
> I am not sure about the differences between the three java message
protocols mentioned in the subject.
> Ok, they are different protocols but what are the (dis)advantages of each
(particularly betwen JMS and RMI)?

SOAP, Simple Object Access Protocol, is a format for transfering data
between a client and server using high level protocols (predominantly HTTP
and XML). They managed to take a rather simple concept of using XML for
remote procedure calls and complicate it to no end, yet laughingly keep the
'S' (for Simple) in the acronym.

RMI, Remote Method Invocation, is Java's native RPC interface. It allows
you to run remote objects with similar semantics to local objects. The
default implementation uses a propietary binary communication protocol, but
technically you can implement RMI over SOAP (or anything else) if you really
wanted to.

JMS, Java Messaging System, is Java's interface and specification to Message
Oriented Middleware. The basic idea is that you ship packets of data to
message queues and topics where they will be operated upon In Due Time
asynchronously. There is no requirement that the queues or topics be remote.
You can easily have an embedded JMS system that doesn't use any remote
protocol, and simply passes objects around. Internally, your JMS server
could be using RMI, SOAP, anything it wants.

JMS is popular now because it does a pretty good job of hiding a lot of the
chicanery that is involved with remote protocols. It's usually handled by
the JMS server and its client library. JMS also isn't your typical RPC
mechanism, as it doesn't cleanly provide that transparent calling scheme for
synchronous calls that RMI and SOAP do. If the semantics of JMS work for
your application, it's pretty easy to use.

RMI and SOAP are a lot more complicated to set up with lots of component
parts to get right. If you really want remote method calls, I'd go and look
at EJBs. The modern J2EE server is pretty simple to set up, easier I'd argue
than a custom RMI solution, and easier than SOAP, particularly for
complicated object structures as EJB can rely on simple Java serialization.

Of course, the best solution if practical is to not do anything remotely at
all, as remote calls smash any sense of performance and complicate the whole
process.

So, if JMS will work for you, use JMS. It's protocol agnostic, by the simple
fact that you are isolated from the protocol completely. Otherwise I'd look
at EJBs. Only use SOAP if you are required to for interoperability with
somebody else. RMI is a legacy system best used for writing custom remote
servers, and frankly have been usurped by EJB for most human beings today.

Regards,

Will Hartung
(willh@msoft.com)



Relevant Pages

  • Re: PORT 135 still open with Norton PF 2002
    ... Protocol: ... TCP or UDP ... Remote service: Any Service ...
    (comp.security.firewalls)
  • Re: Voice Chat & Web Cam
    ... "The Remote Assistance feature uses Remote Desktop Protocol, ... applying specific ISA Server configuration for each individual Remote ... and will not succeed through ISA Server if the session is initiated by the ...
    (microsoft.public.isaserver)
  • openssh question
    ... But they cannot connect to the ssh server. ... com.sshtools.j2ssh.SshServer - Remote Hostname: localhost ... com.sshtools.j2ssh.transport.TransportProtocolCommon - Starting transport ... transport protocol messages with inputstream ...
    (comp.security.ssh)
  • Remote Desktop Disconnected Error, have to try multiple times when RWW server
    ... When i try to RWW server, i got a "VB Script: Remote Desktop ... "Client disconnected due to internal protocol error: Error connecting ... The RDP protocol component WD detected an error in the protocol stream ...
    (microsoft.public.windows.server.sbs)
  • Re: Porting a web-app from win/COM world to Jsp/Tomcat...
    ... >>> advantage of your current architecture is that you could let the ... > If you've already got RMI experience, ... but the key problem is getting your protocol right. ... > you can run the system using proxies which fake the comms gap.. ...
    (comp.lang.java.programmer)