-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-13864: provide the construct interceptor for KafkaProducer and KafkaConsumer #12125
base: trunk
Are you sure you want to change the base?
Conversation
* won't be called in the consumer when the deserializer is passed in directly. | ||
* @param interceptors The list interceptors for consumer that implements {$link ConsumerInterceptor}. | ||
*/ | ||
public KafkaConsumer(Map<String, Object> configs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid touching to the existing and offer more flexibility, I would have created a new constructor with a ProducerConfig to allow overriding the method ProducerConfig#getConfiguredInstances to complete the list of interceptors with instances or any other type of instances such as the MetricsReporter of the partitioner. See the Spring issue for a concrete example: spring-projects/spring-kafka#2244
This approach can work as well.
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
Show resolved
Hide resolved
Tests and checks are failing. |
@lqjack , based on the discussion thread, the KIP has been updated as follow Do you expect to update the PR to follow what is described in the KIP or do you prefer I do it? |
As mentioned in the Jira ticket, KIP-832 won't be implemented and will be replaced by KIP-839. |
*Provide the constructor for producer and consumer to configure the interceptor.
Committer Checklist (excluded from commit message)