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 |
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
- url:
/get_stock_price
- method signature:
double getStockPrice(String stockName)
- import as maven project
- run
HessianServer.java
- run
HessianClient.java
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 ===