[jira] [Commented] (KAFKA-17478) Wrong configuration of metric.reporters lead to NPE in KafkaProducer constructor

2024-09-04 Thread Fred Rouleau (Jira)


[ 
https://issues.apache.org/jira/browse/KAFKA-17478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879175#comment-17879175
 ] 

Fred Rouleau commented on KAFKA-17478:
--

The exception is raised by 
List reporters = 
CommonClientConfigs.metricsReporters(clientId, config);
before the Optional field clientTelemetryReporter is instantiated. The 
exception handler is calling close() which expect to have 
clientTelemetryReporter being instantiated.
 
Swapping 2 lines just allow the field not to be null and then to have the 
proper exception being raised.

> Wrong configuration of metric.reporters lead to NPE in KafkaProducer 
> constructor
> 
>
> Key: KAFKA-17478
> URL: https://issues.apache.org/jira/browse/KAFKA-17478
> Project: Kafka
>  Issue Type: Bug
>  Components: clients
>Affects Versions: 3.7.0, 3.8.0, 3.7.1
>Reporter: Fred Rouleau
>Assignee: Fred Rouleau
>Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> if the metric.reporters property contains some invalid class, the 
> KafkaProducer constructor fails with non explicit NPE:
> {code:java}
> Exception in thread "main" java.lang.NullPointerException: Cannot invoke 
> "java.util.Optional.ifPresent(java.util.function.Consumer)" because 
> "this.clientTelemetryReporter" is null
>     at 
> org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:1424)
>     at 
> org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:472)
>     at 
> org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:295)
>     at 
> org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:322)
>     at 
> org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:307)
>     at org.frouleau.kafka.clients.Produce.sendAvroSpecific(Produce.java:89)
>     at org.frouleau.kafka.clients.Produce.main(Produce.java:63){code}
> This behavior was introduced by KAFKA-15901 implementing KIP-714.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (KAFKA-16507) Add raw record into RecordDeserialisationException

2024-04-10 Thread Fred Rouleau (Jira)


 [ 
https://issues.apache.org/jira/browse/KAFKA-16507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fred Rouleau updated KAFKA-16507:
-
Labels: kip  (was: )

> Add raw record into RecordDeserialisationException
> --
>
> Key: KAFKA-16507
> URL: https://issues.apache.org/jira/browse/KAFKA-16507
> Project: Kafka
>  Issue Type: Improvement
>  Components: consumer
>Reporter: Fred Rouleau
>Priority: Minor
>  Labels: kip
>
> [KIP-334|https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=87297793]
>  introduced into the Consumer the RecordDeserializationException with offsets 
> information. That is useful to skip a poison pill but as you do not have 
> access to the Record, it still prevents easy implementation of dead letter 
> queue or simply logging the faulty data.
> Changes are described in 
> [KIP-1036|https://cwiki.apache.org/confluence/display/KAFKA/KIP-1036%3A+Extend+RecordDeserializationException+exception]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (KAFKA-16507) Add raw record into RecordDeserialisationException

2024-04-10 Thread Fred Rouleau (Jira)
Fred Rouleau created KAFKA-16507:


 Summary: Add raw record into RecordDeserialisationException
 Key: KAFKA-16507
 URL: https://issues.apache.org/jira/browse/KAFKA-16507
 Project: Kafka
  Issue Type: Improvement
  Components: consumer
Reporter: Fred Rouleau


[KIP-334|https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=87297793]
 introduced into the Consumer the RecordDeserializationException with offsets 
information. That is useful to skip a poison pill but as you do not have access 
to the Record, it still prevents easy implementation of dead letter queue or 
simply logging the faulty data.

Changes are described in 
[KIP-1036|https://cwiki.apache.org/confluence/display/KAFKA/KIP-1036%3A+Extend+RecordDeserializationException+exception]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)