tree: f4f5711d1a01a17c13ea0fd0a9fadcbab69d79ac [path history] [tgz]
  1. dubbo-samples-thrift-api/
  2. dubbo-samples-thrift-impl/
  3. case-configuration.yml
  4. case-versions.conf
  5. pom.xml
  6. README.md
dubbo-samples-thrift/README.md

Thrift samples

How to build

  1. Install thrift

Download thrift binary from here. If you work on Mac OS, you can simply install it with the following command:

brew install thrift
  1. Generate DemoService.java

Once you update the location of the thrift binary downloaded just now in pom.xml:

<properties>
    <thrift.path>/usr/local/bin/thrift</thrift.path>
</properties>

then you can execute the following command to generate org.apache.dubbo.samples.rpc.nativethrift.api.DemoService from thrift/DemoService.thrift:

mvn -Pthrift-gen clean package

Alternatively you can use the following script to achieve the same purpose:

#!/usr/bin/env bash
service_dir="./java/"
for thrift_file in ./idls/*
do
    if test -f ${thrift_file}
    then
        thrift --gen java --out ${service_dir} ${thrift_file}
    fi
done

Once the DemoService.java is generated, you can use the following command for the continuous build:

mvn clean package