[ https://issues.apache.org/jira/browse/KAFKA-7052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17032488#comment-17032488 ]
Randall Hauch commented on KAFKA-7052: -------------------------------------- Thanks for the discussion, everyone. As soon as we introduce a configuration option on a Connect-provided SMT, we need a KIP and we can't backport the change. I would suggestion the following: # One PR to improve the error message per [~rmoff]'s earlier comment (e.g., "ExtractField : field 'id' not found in Key") but otherwise not change the behavior. Or, we make the message better and we decide that "skip" is an appropriate fix rather than an NPE; this may need more discussion, but I think NPE is a bad UX and probably rarely useful. This would be able to be merged on trunk and backported to 2-3 branches (standard practice). # Create a new Jira issue and small KIP and another PR to add the proposed ExtractField configuration property, such as "{{behavior.on.non.existant.field}} = {{(fail|drop|skip)}}". Note I'm suggesting using "skip" rather than "passon" to keep things simple. [~gunnar.morling]'s PR would apply to this new Jira issue and KIP rather than to this issue. # Create a new Jira issue and KIP to define an optional topic filter property for each transformation that would specify a regex pattern matching the topics to which the SMT should apply, and defaulting to ".*" to maintain the current behavior. I'm not sure how feasible this will be to ensure it never clashes with SMT-specific properties, but it's worth investigating. Important: We've already missed the KIP acceptance deadline for AK 2.5, so the earliest #2 and #3 could appear is AK 2.6. WDYT? > ExtractField SMT throws NPE - needs clearer error message > --------------------------------------------------------- > > Key: KAFKA-7052 > URL: https://issues.apache.org/jira/browse/KAFKA-7052 > Project: Kafka > Issue Type: Improvement > Components: KafkaConnect > Reporter: Robin Moffatt > Priority: Major > > With the following Single Message Transform: > {code:java} > "transforms.ExtractId.type":"org.apache.kafka.connect.transforms.ExtractField$Key", > "transforms.ExtractId.field":"id"{code} > Kafka Connect errors with : > {code:java} > java.lang.NullPointerException > at > org.apache.kafka.connect.transforms.ExtractField.apply(ExtractField.java:61) > at > org.apache.kafka.connect.runtime.TransformationChain.apply(TransformationChain.java:38){code} > There should be a better error message here, identifying the reason for the > NPE. > Version: Confluent Platform 4.1.1 -- This message was sent by Atlassian Jira (v8.3.4#803005)