storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From churly lin <chury...@gmail.com>
Subject questions about multilang bolt's STDIN&STDOUT
Date Wed, 08 Jan 2014 07:24:56 GMT
Hi all,

I am trying to write a topology with a KafkaSpout and a
ShellBolt(implemented by python ).
According to the
Multilang-protocol<https://github.com/nathanmarz/storm/wiki/Multilang-protocol>,
multilang uses json messages over stdin/stdout to communicate with the
subprocess. Specially, *both ends of this protocol use a line-reading
mechanism. *Does it mean that, in multilang, we could not emit message as
byte array? If not, how to read a byte array tuple in a python bolt ?
the json which was read by python bolt is look like:

{
        "command": "emit",
        // The id for the tuple. Leave this out for an unreliable
emit. The id can
    // be a string or a number.
        "id": "1231231",
        // The id of the stream this tuple was emitted to. Leave this
empty to emit to default stream.
        "stream": "1",
        // If doing an emit direct, indicate the task to send the tuple to
        "task": 9,
        // All the values in this tuple
        "tuple": ["field1", 2, 3]}

This example shows that, the "tuple" can be String("field1") and number(2,
3). Could it be a byte array?

Mime
View raw message