10 Jun 2018

windows 下 thrift的安装

The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages.

Apache Thrift软件框架用于可扩展的跨语言服务开发,简单来说就是RPC远程调用,它是一个完整的 RPC 框架体系。

官网: http://thrift.apache.org/

1. 安装过程

创建thrift home 目录 (E:\nunu\thrift) 将下载的thrift-0.11.0.exe 重命名为thrift.exe 将thrift.exe 放在thrift home目录下 在环境变量path中添加(E:\nunu\thrift)

2. 测试thrift


    namespace java cn.pnunu.thrift.demo
    namespace py thrift.demo
    service DemoService {
        void sayHello(1:string name);


    ## thrift --gen <language> <Thrift filename>
    thrift --gen java thrift.demo.txt     ## 生成java文件
    thrift --gen py thrift.demo.txt       ## 生成Python文件


生成java文件 生成Python文件

业精于勤,荒于嬉; 行成于思,毁于随。
pnunu at 22:13

Flag Counter