package com.orendainx.hortonworks.trucking.storm.schemes

import java.nio.ByteBuffer

import org.apache.storm.tuple.{Fields, Values}

/**
  * Scheme for parsing speed events.
  *
  * @author Edgar Orendain <edgar@orendainx.com>
  */
class BytesToStringScheme(dataType: String) extends DelimitedScheme("\\|") {

  override def deserialize(buffer: ByteBuffer): Values = new Values(dataType, deserializeAsString(buffer))

  override def getOutputFields: Fields = new Fields("dataType", "data")
}

package com.orendainx.hortonworks.trucking.storm.schemes

import java.nio.ByteBuffer

import org.apache.storm.tuple.{Fields, Values}

/**
  * Scheme for parsing speed events.
  *
  * @author Edgar Orendain <edgar@orendainx.com>
  */
class BytesToStringScheme(dataType: String) extends DelimitedScheme("\\|") {

  override def deserialize(buffer: ByteBuffer): Values = new Values(dataType, deserializeAsBytes(buffer))

  override def getOutputFields: Fields = new Fields("dataType", "data")
}

--- 
+++ 
@@ -11,7 +11,7 @@
   */
 class BytesToStringScheme(dataType: String) extends DelimitedScheme("\\|") {
 
-  override def deserialize(buffer: ByteBuffer): Values = new Values(dataType, deserializeAsBytes(buffer))
+  override def deserialize(buffer: ByteBuffer): Values = new Values(dataType, deserializeAsString(buffer))
 
   override def getOutputFields: Fields = new Fields("dataType", "data")
 }
Use correct scheme for Kafka Spout
