This is an automated email from the ASF dual-hosted git repository.

atoomula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git


The following commit(s) were added to refs/heads/master by this push:
     new 9cb275a  Fix ConsoleLoggingSystemFactory to handle null message value. 
(#1123)
9cb275a is described below

commit 9cb275a4424469cc220263b936e1fc514cef594c
Author: Aditya Toomula <[email protected]>
AuthorDate: Thu Aug 1 09:51:22 2019 -0700

    Fix ConsoleLoggingSystemFactory to handle null message value. (#1123)
---
 .../main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/samza-tools/src/main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java
 
b/samza-tools/src/main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java
index b271ccd..4f18cd8 100644
--- 
a/samza-tools/src/main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java
+++ 
b/samza-tools/src/main/java/org/apache/samza/tools/ConsoleLoggingSystemFactory.java
@@ -85,7 +85,7 @@ public class ConsoleLoggingSystemFactory implements 
SystemFactory {
     @Override
     public void send(String source, OutgoingMessageEnvelope envelope) {
       String msg = String.format("OutputStream:%s Key:%s Value:%s", 
envelope.getSystemStream(), envelope.getKey(),
-          new String((byte[]) envelope.getMessage()));
+          envelope.getMessage() != null ? new String((byte[]) 
envelope.getMessage()) : null);
       LOG.info(msg);
 
       System.out.println(String.format("Message %d :", 
messageCounter.incrementAndGet()));
@@ -97,7 +97,7 @@ public class ConsoleLoggingSystemFactory implements 
SystemFactory {
     }
 
     private String getFormattedValue(OutgoingMessageEnvelope envelope) {
-      String value = new String((byte[]) envelope.getMessage());
+      String value = envelope.getMessage() != null ? new String((byte[]) 
envelope.getMessage()) : null;
       String formattedValue;
 
       try {

Reply via email to