Could someone please explain what is the difference between rpc,rmi, jms and webservices. Webservices what I know are soap and rest. I didn't understand how jms comes into picture while using webservices and also what is the use of esb?
1 Answers
RPC and RMI are tightly coupled ways to invoke a method on a remove server application.
RCP is the C/C++ version, RMI is the Java version, see What is the difference between Java RMI and RPC?
for further info.
But you can safely forget about RPC and RMI because they have this tight coupling and they are considered 'unmodern' by now. For example to get the address of 'Pete' from a server, the client would call something like: address = server.getAddress("Pete")
The problem here is that when you make a little change on the Server's API, you need to upgrade all clients as well. If you have more than one client to one server, it leads to 'upgrade hell'.
JMS is better because you communicate over messages, not method invocations. You send the information packets (=messages) from one component to the other. Informing the other side about events. For example client1 could send a message: msg.setJMSReplyTo("client1"); producer.send( "ADDRESS-SERVER", msg ); response = consumer.receive()
(pseudo-code) and get the message. The server could add new response fields (street/ZIP code), e.g. for client2, to the address without breaking the communication with client1.
JMS can be request/reply, but can also be publish-subscribe (the best method for enterprise integrations). JMS providers are many, some free like ActiveMQ and usually very efficent in terms of messages per second.
WebServices are HTTP-based. Either REST or SOAP. SOAP is kind of outdated. REST makes use of special URL's to GET or POST information to/from a webserver. If high performance is important (100k requests per second or more), you should consider JMS, but if you have experience with WebServers, etc. also REST could be good for integration. One advantage of WebServices is that you can use standard Browsers to debug this service and that often firewalls are easier to get opened on port 8080.
My advice, if you don't have preferences: learn about JMS Topics and start thinking how to solve problems with 'event-driven/push-computing' - especially in the backend this is a good architecture. For more frontend-related integration REST WebServices is the way to go.

- 4,034
- 29
- 41
-
Thanks a lot Axel. I came across web services using jms which making me confuse . Restful webservices uses http protocol how come jms is used in restful webservices. Please explain. Thanks – Get Itdone Apr 09 '19 at 14:09
-
Do you have a link to that service? Jms could be using http or vice versa (tunneling?) – Axel Podehl Apr 09 '19 at 19:48