mjsax commented on code in PR #17169:
URL: https://github.com/apache/kafka/pull/17169#discussion_r1757696994


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/RecordCollectorImpl.java:
##########
@@ -298,19 +315,19 @@ private <K, V> void handleException(final 
ProductionExceptionHandler.Serializati
                                         final Integer partition,
                                         final Long timestamp,
                                         final String processorNodeId,
-                                        final InternalProcessorContext<Void, 
Void> context,
+                                        final RecordContext recordContext,
                                         final RuntimeException 
serializationException) {
         log.debug(String.format("Error serializing record for topic %s", 
topic), serializationException);
 
         final DefaultErrorHandlerContext errorHandlerContext = new 
DefaultErrorHandlerContext(
             null, // only required to pass for DeserializationExceptionHandler
-            context.recordContext().topic(),
-            context.recordContext().partition(),
-            context.recordContext().offset(),
-            context.recordContext().headers(),
+            recordContext != null ? recordContext.topic() : null,
+            recordContext != null ? recordContext.partition() : -1,
+            recordContext != null ? recordContext.offset() : -1,
+            recordContext != null ? recordContext.headers() : new 
RecordHeaders(),

Review Comment:
   Not sure how this would work? -- Yes, we need to check if  `context == 
null`, and for this case set `recordContext = null` instead of `recordContext = 
context.recordContext()`. But not sure how I can avoid the `recordContext` null 
check?
   
   Let me extract into a helper method to avoid code duplication though.



-- 
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: [email protected]

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

Reply via email to