general java
apache httpclient와 protobuff를 이용해서 RPC 구현
'김용환'
2012. 5. 18. 10:34
interface를 client, server에 배포해두고. 서버에서 interface를 실제 구현한 클래스를 정의한다.
Http를 이용해서 entity에 추가해서 송수신하는 message format을 정의한다. serialization은 protostuff를 사용할 수 있다. client에서는 단순히 interface에 정의된 것만 호출함으로 rpc 효과를 얻을 수 있다.
protobuff가 성능도 용량도 작아서 많이 쓸만해 보임
Protostuff is the stuff that leverages google's protobuf.
A serialization library with built-in support for forward-backward compatibility (schema evolution) and validation.
- available formats:
- protostuff (native)
- graph (protostuff with support for cyclic references. See SerializingObjectGraphs)
- protobuf
- json
- smile (binary json useable from the protostuff-json module. See http://wiki.fasterxml.com/SmileFormat)
- xml
- yaml (ser only)
- kvp (binary uwsgi header)