-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of proxy in DefaultKafkaConsumerFactory (#2822)
* Get rid of proxy in DefaultKafkaConsumerFactory The proxy in the `DefaultKafkaConsumerFactory` for `KafkaConsumer` is created only to intercept `close()` call to remove an instance from the `listeners`. There is no need in such a proxy since simple `KafkaConsumer` class extension can handle that scenario. The reason behind this change is to avoid a `Serializable` (`java.lang.reflect.Proxy`) header in the produced message for the `KafkaConsumer` where we still fail to serialize it because other properties of the proxy are not `Serializable` * Introduce `DefaultKafkaConsumerFactory.ExtendedKafkaConsumer` to handle `listeners` interaction * The `createRawConsumer()` might be considered as breaking change since now end-user must extend this `ExtendedKafkaConsumer` to be able to handle `listeners` same way as before * Adjust `DefaultKafkaConsumerFactoryTests.listener()` test for the current code state * * Log warn for ignored `listeners` and not an `ExtendedKafkaConsumer` * Log polishing. --------- Co-authored-by: Gary Russell <[email protected]>
- Loading branch information
1 parent
e95f041
commit 638ee01
Showing
2 changed files
with
56 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters