Thank you for your answer.
How can I use guessProtocolFactory? From what I see in thrift source code, the only way to accept any protocol is to create my own class that extends org.apache.thrift.protocol.TProtocol. I think detecting protocol can be done in readMessageBegin() method. Is there any other way to use guessProtocolFactory? Best regards serj