Hello,

*1- Can anyone explain how to convert storm tuple to byte array. I have
used the following code. *

private byte[] convertToBytes(Object object) throws IOException {
    try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(bos)) {
     out.writeObject(object);
        return bos.toByteArray(); } }

*Getting the following error :*
java.io.NotSerializableException: org.apache.storm.tuple.TupleImpl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
at
storm.starter.OurStatefulBoltByteArrayTuple.convertToBytes(OurStatefulBoltByteArrayTuple.java:200)

*2- If the conversion can not be done like this then how does storm does
serialization of tuple over the network. Can anyone point me out that code
logic? *

Reply via email to