Thrift Integration Conventions
Thrift is designed to to be pluggable at various levels of the stack. This page is meant to describe conventions for integrating Thrift into other systems.
HTTP
- Thrift messages should be sent over HTTP/1.1 with Content-Length headers on both the request and response.
- Thrift messages should be sent over HTTP POST.
- The request should be the POST body. No mime or url encoding should be used, just raw bytes.
- The response should be the HTTP response. Again, raw bytes.
- The Content-Type header for both request and response should be "application/x-thrift".
- No framing should be used within either the request or response.
- oneway requests should not be used over HTTP.
These conventions are followed by multiple HTTP classes in the Thrift source tree.
SSL
- TODO
SASL
- TODO
ZeroMQ
- Normal Thrift calls should be made over REQ/REP sockets.
- oneway requests can be made over PUSH/PULL or PUB/SUB sockets.
- The request and response should be the entire content of the zmq message: no framing or encoding.
These conventions are followed by the patches at https://issues.apache.org/jira/browse/THRIFT-812 .