[工作點滴] msgpack-idl howto

msgpack-idl howto

Step1 get the msgpack-idl

$ git clone git://github.com/msgpack/msgpack-idl.git

Step2 install the ruby tool that required

$ sudo apt-get install ruby1.9.1

Step3 go to msgpack-idl folder.

$ sudo gem install msgpack-idl

$ sudo msgpack-idl –install java

Step4 create a sample file ‘sample’ with content as follow.

message Node { ``1``: string address ``2``: map<string,string> properties ``3``: optional string? description } message StorageNode < Node { ``4``: long capacity ``5``: optional int weight = 1 }

Step 5 generate the java code by following command

$ msgpack-idl --example sample > sample.msgspec $ msgpack-idl -g java sample.msgspec -o ./out/

More information, see following link:

http://wiki.msgpack.org/display/MSGPACK/Design+of+IDL

But this seems support to generate Java only. Another idl implementation that written in Haskell is more active than the Ruby implementation.

It can generate c++ code. To study it later if we really need IDL for our ipc.

Link as follow:

http://hackage.haskell.org/packages/hackage.html


Comments & Feedback