Skip to content

chennanni/crack-java-rpc-frameworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java RPC Frameworks

This project is to implement and compare several common Java RPC frameworks.

  • Java RMI (TODO)
  • Hessian
  • Dubbo (TODO)
  • MORE...

Comparison:

Type Serialization/Deserialization Data Transfer Protocol
Java RMI Java Serialization HTTP
Hessian Hessian Serialization HTTP
Dubbo Configurable - Hessian Serialization TCP

How RPC works

rpc_workflow

How RPC implements

rpc_arch

User Story

Functionality

As a user of App A, I want to get the key-value mapping of some stock's price by querying App B's API.

example:

  • A's input: apple
  • B's output: 150

API

  • url: /get_stock_price
  • method signature: double getStockPrice(String stockName)

Hessian

Run Instruction

  • import as maven project
  • run HessianServer.java
  • run HessianClient.java

Sample Output

Server

o.example.hessian.server.HessianServer   : Started HessianServer in 0.726 seconds (JVM running for 1.323)
o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
o.s.web.servlet.DispatcherServlet        : Completed initialization in 0 ms

Client

=== start ===
apple: 150.0
taobao: -1.0
=== end ===

Reference

Reference

About

implement and compare several common Java RPC frameworks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages