1 / 16

Distributed Java Communications

Distributed Java Communications. Eric Lind CS522 Semester Project December 9, 2002. How does one distribute using Java?. Many different methods are available Sockets RMI CORBA XML (SOAP or JAX). How do I decide which to use?. Each new trend claims to be faster/stronger/better

Télécharger la présentation

Distributed Java Communications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Java Communications Eric Lind CS522 Semester Project December 9, 2002

  2. How does one distribute using Java? • Many different methods are available • Sockets • RMI • CORBA • XML (SOAP or JAX)

  3. How do I decide which to use? • Each new trend claims to be faster/stronger/better • Can be hard to compare different methods • Numbers are hard to come by • Which numbers to use?

  4. Project Benchmarks • Use a simple chat application • Contrived, yes, but still demonstrates features of each method • Measure data written and read by each client or server • Not concerned with low-level traffic, but with the application level data.

  5. Sockets Server Client Connection Request Port Bi-Directional Connection Port Port

  6. Advantages: Nearly universal Uses the smallest amount of data to communicate Bi-directional Disadvantages: Pretty low-level Must do many things by hand No additional services provided Sockets

  7. RMI Registry Obtain Remote Reference Obtain Remote Reference RMIChat receive(Message) RMIChat Port Port receive(Message) Each RMIChat object must implement both the client and server interface

  8. Advantages: Standard Java API Allows remote objects to be treated as if local Includes some services Disadvantages: Uses client-pull (clients must also be servers for 2-way comm.) Setup code is cumbersome Marshalling is slow RMI

  9. CORBA IIOP ORB ORB CORBAChat CORBAChat As with RMI, each CORBAChat object must act as both client and server

  10. Advantages: Open standard Many platforms / languages Provides additional services Generally faster than RMI Disadvantages: Not “Java-friendly” Uses client-pull Tends to be trickier than other methods Had considerable trouble with generated classes CORBA

  11. Chat Service Ties Runtime Runtime Runtime Stubs Stubs JAXChat JAXChat JAX-RPC Tomcat (or any Servlet-enabled Web Server) SOAP Message SOAP Message HTTP HTTP

  12. Advantages: Uses SOAP (can talk to non-Java platforms) Very easy to develop Uses HTTP (eases security concerns) Disadvantages: Uses SOAP (XML is very verbose) Requires web server Restricts data that can be sent Still buggy JAX-RPC

  13. Benchmark Results

  14. Conclusions • Sockets have the lowest overhead • RMI does not add much (only 43 extra bytes) • XML adds a lot of overhead (19 times) • Must convert binary data to text • SOAP envelope is huge

  15. Conclusions (cont.) • RMI is probably the best for pure-Java applications • Low overhead • Normal Java semantics • RMI over IIOP should put RMI on par with CORBA for speed.

  16. Conclusions (cont.) • Web Services are (supposedly) platform neutral • Good model for general data access, not so good for bandwidth constrained applications • CORBA is still the only viable, cross-platform communications protocol, but it’s not easy to use

More Related