You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/27 13:36:44 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #16740: [feature][connectors] Add support for a preprocess Function in Sinks

eolivelli commented on code in PR #16740:
URL: https://github.com/apache/pulsar/pull/16740#discussion_r931073201


##########
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java:
##########
@@ -384,7 +386,12 @@ private void sendOutputMessage(Record srcRecord, Object output) throws Exception
         try {
             this.sink.write(sinkRecord);
         } catch (Exception e) {
-            log.info("Encountered exception in sink write: ", e);
+            if (e instanceof ClassCastException && functionClassLoader != componentClassLoader) {

Review Comment:
   you can't because each record can be different
   
   in Java even if you declare a class with some Generic types, you can always force the system to return something wrong.
   so this check must stay here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org