A server for the Thrift protocol served over com.twitter.finagle.mux.
ThriftMuxServer is backwards-compatible with Thrift clients that use the
framed transport and binary protocol. It switches to the backward-compatible
mode when the first request is not recognized as a valid Mux message but can
be successfully handled by the underlying Thrift service. Since a Thrift
message that is encoded with the binary protocol starts with a header value of
0x800100xx, Mux does not confuse it with a valid Mux message (0x80 = -128 is
an invalid Mux message type) and the server can reliably detect the non-Mux
Thrift client and switch to the backwards-compatible mode.
Note that the server is also compatible with non-Mux finagle-thrift clients.
It correctly responds to the protocol up-negotiation request and passes the
tracing information embedded in the thrift requests to Mux (which has native
tracing support).
A server for the Thrift protocol served over com.twitter.finagle.mux. ThriftMuxServer is backwards-compatible with Thrift clients that use the framed transport and binary protocol. It switches to the backward-compatible mode when the first request is not recognized as a valid Mux message but can be successfully handled by the underlying Thrift service. Since a Thrift message that is encoded with the binary protocol starts with a header value of 0x800100xx, Mux does not confuse it with a valid Mux message (0x80 = -128 is an invalid Mux message type) and the server can reliably detect the non-Mux Thrift client and switch to the backwards-compatible mode.
Note that the server is also compatible with non-Mux finagle-thrift clients. It correctly responds to the protocol up-negotiation request and passes the tracing information embedded in the thrift requests to Mux (which has native tracing support).