sneakyburro opened a new pull request #8752:
URL: https://github.com/apache/kafka/pull/8752


   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   
https://stackoverflow.com/questions/61790984/kafka-stream-forward-method-throwing-nullpointerexception-because-processornode/61978396)
   User provided ProcessorSupplier may have change to always return the same 
instance. Multiple ProcessorContext tried to register in a same processor 
instance, but processor instance could only have one ProcessorContext to 
callback. So the time StreamThread who owns each ProcessorContext dispatch 
records to processor instance and callback somewhere else(not its thread local 
ProcessorContext). And it led to inconsistency.
   Wrong samples here:
   ```
   .addProcessor("Process", () -> fileExtractProcessorObject , 
"sourceProcessor")
   ```
   
   So this commit 
   * check violation of our **Supplier** pattern during initialization. 
   * improve java docs
   * add a section in official docucment to explicitly remind users
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   Unit tests should remains same behaviors as before except for wrong usages.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to