Hello,

I am working on a basic Samza task that pulls from one Kafka topic and writes 
to another. This task runs in Yarn but the Output topic does not contain any 
data. 


In order to troubleshoot this more effectively I would like to log the incoming 
message as my example below. Ideally, I would like to be able to see the log 
messages in Yarn, maybe in the .out files in the /logs directory. 


Any advice is appreciated. 



Here is my task:


package com.project.samza.tasks;


import java.util.Map;
import org.apache.samza.system.IncomingMessageEnvelope;
import org.apache.samza.system.OutgoingMessageEnvelope;
import org.apache.samza.system.SystemStream;
import org.apache.samza.task.MessageCollector;
import org.apache.samza.task.StreamTask;
import org.apache.samza.task.TaskCoordinator;


public class exampleStreamTask implements StreamTask {
  private static final SystemStream OUTPUT_STREAM = new SystemStream(“kafka”, 
“new-topic-test”);


  @Override
  public void process(IncomingMessageEnvelope envelope,
      MessageCollector collector,
      TaskCoordinator coordinator) {
          String msg = (String) envelope.getMessage();
          System.out.println(msg);
          collector.send(new OutgoingMessageEnvelope(OUTPUT_STREAM, msg));
  }
}


Thanks, 


Jason

Reply via email to