eolivelli commented on a change in pull request #9943:
URL: https://github.com/apache/pulsar/pull/9943#discussion_r596317775



##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
##########
@@ -736,8 +737,14 @@ private void setupOutput(ContextImpl contextImpl) throws 
Exception {
                 
pulsarSinkConfig.setProcessingGuarantees(FunctionConfig.ProcessingGuarantees.valueOf(
                         
this.instanceConfig.getFunctionDetails().getProcessingGuarantees().name()));
                 pulsarSinkConfig.setTopic(sinkSpec.getTopic());
-                pulsarSinkConfig.setForwardSourceMessageProperty(
+                
+                if 
(this.instanceConfig.getFunctionDetails().getComponentType()== 
ComponentType.SOURCE) {
+                  // Forward record level properties for all sources by default
+                  pulsarSinkConfig.setForwardSourceMessageProperty(true);
+                } else if 
(this.instanceConfig.getFunctionDetails().getComponentType() == 
ComponentType.SINK) {

Review comment:
       Can this be a simple `else` ? ( without `if`)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to