merlimat closed pull request #1590: Handle NPE for output producer is null for 
function
URL: https://github.com/apache/incubator-pulsar/pull/1590
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/utils/DefaultSerDe.java
 
b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/utils/DefaultSerDe.java
index 543823dba..1fc9a492e 100644
--- 
a/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/utils/DefaultSerDe.java
+++ 
b/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/utils/DefaultSerDe.java
@@ -36,6 +36,7 @@
             Integer.class,
             Double.class,
             Long.class,
+            Boolean.class,
             String.class,
             Short.class,
             Byte.class,
diff --git 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/processors/AtLeastOnceProcessor.java
 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/processors/AtLeastOnceProcessor.java
index 38c101513..c8fecbf06 100644
--- 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/processors/AtLeastOnceProcessor.java
+++ 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/processors/AtLeastOnceProcessor.java
@@ -54,7 +54,7 @@ protected void initializeOutputProducer(String outputTopic) 
throws Exception {
 
     @Override
     public void sendOutputMessage(InputMessage inputMsg, MessageBuilder 
outputMsgBuilder) {
-        if (null == outputMsgBuilder) {
+        if (null == outputMsgBuilder || null == producer) {
             inputMsg.ack();
             return;
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to