gharris1727 commented on code in PR #15154: URL: https://github.com/apache/kafka/pull/15154#discussion_r1449351768
########## connect/runtime/src/main/java/org/apache/kafka/connect/runtime/errors/DeadLetterQueueReporter.java: ########## @@ -121,20 +121,22 @@ public static DeadLetterQueueReporter createAndSetup(Map<String, Object> adminPr /** * Write the raw records into a Kafka topic and return the producer future. * - * @param context processing context containing the raw record at {@link ProcessingContext#consumerRecord()}. + * @param context processing context containing the raw record at {@link ProcessingContext#original()}. * @return the future associated with the writing of this record; never null */ - public Future<RecordMetadata> report(ProcessingContext context) { + @SuppressWarnings("unchecked") + public Future<RecordMetadata> report(ProcessingContext<?> context) { if (dlqTopicName.isEmpty()) { return CompletableFuture.completedFuture(null); } errorHandlingMetrics.recordDeadLetterQueueProduceRequest(); - ConsumerRecord<byte[], byte[]> originalMessage = context.consumerRecord(); - if (originalMessage == null) { + if (!(context.original() instanceof ConsumerRecord)) { errorHandlingMetrics.recordDeadLetterQueueProduceFailed(); return CompletableFuture.completedFuture(null); } + ProcessingContext<ConsumerRecord<byte[], byte[]>> sinkContext = (ProcessingContext<ConsumerRecord<byte[], byte[]>>) context; Review Comment: Yes, but ConsumerRecord has no subclasses, and we never create a ProcessingContext for anything other than SourceRecord and ConsumerRecord<byte[], byte[]>. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org