319.4. thrift 形式の定義
最初のステップでは、エクスチェンジのボディーの形式を定義します。これは、以下のように .thrift ファイルで定義されます。
tutorial.thrift
namespace java org.apache.camel.dataformat.thrift.generated enum Operation { ADD = 1, SUBTRACT = 2, MULTIPLY = 3, DIVIDE = 4 } struct Work { 1: i32 num1 = 0, 2: i32 num2, 3: Operation op, 4: optional string comment, }
namespace java org.apache.camel.dataformat.thrift.generated
enum Operation {
ADD = 1,
SUBTRACT = 2,
MULTIPLY = 3,
DIVIDE = 4
}
struct Work {
1: i32 num1 = 0,
2: i32 num2,
3: Operation op,
4: optional string comment,
}