Beispiel #1
0
 /**
  * Decode avro message
  *
  * @param Xcom_Xfabric_Model_Message_Abstract $message
  * @return Xcom_Xfabric_Model_Encoder_Avro
  */
 public function decode(Xcom_Xfabric_Model_Message_Abstract $message)
 {
     $rawSchema = $message->getSchema()->getRawSchema();
     $decodedBody = $this->decodeText($message->getBody(), $rawSchema);
     $message->setBody($decodedBody);
     return $this;
 }
Beispiel #2
0
 /**
  * Decode json data and retrieve array.
  *
  * @param Xcom_Xfabric_Model_Message_Abstract $message
  * @return Xcom_Xfabric_Model_Encoder_Json
  */
 public function decode(Xcom_Xfabric_Model_Message_Abstract $message)
 {
     $data = $message->getBody();
     $result = json_decode($data, true);
     $message->setBody($result);
     return $this;
 }