Skip to content

[2163] Deprecate ProducerListener in favor of ProducerInterceptor #2225

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

Closed
wants to merge 2 commits into from

Conversation

viktorardelean
Copy link

Resolves #2163

Added Deprecated annotation where ProducerListener was used and suggested using ProducerInterceptor instead

Please let me know if there's anything to be changed.

Thanks

@@ -35,8 +35,10 @@
* @author Artem Bilan
*
* @since 2.1.6
*
* @deprecated since 3.0 in favor of {@link org.apache.kafka.clients.producer.ProducerInterceptor}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "in favor of CompositeProducerInterceptor" ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I have modified

@@ -32,7 +32,10 @@
*
* @author Marius Bogoevici
* @author Gary Russell
* @deprecated since 3.0 in favor of {@link org.apache.kafka.clients.producer.ProducerInterceptor}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we don't have a LoggingProducerInterceptor to replace with.
I wonder if we need to implement one...

*/

@Deprecated(since = "3.0", forRemoval = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we deprecate it, we have to replace its usage with the mentioned favor.
Any thoughts what could be done in the that KafkaTemplate for example?

I wonder if you ran your fix locally with the ./gradlew clean check. It must show you that you still use some deprecate API.

garyrussell added a commit to garyrussell/spring-kafka that referenced this pull request May 4, 2022
artembilan pushed a commit that referenced this pull request May 4, 2022
Resolves #2255

* Also move test; fix deprecation warnings.

**Cherry-pick to 2.9.x**
artembilan pushed a commit that referenced this pull request May 4, 2022
Resolves #2255

* Also move test; fix deprecation warnings.

**Cherry-pick to 2.9.x**
@garyrussell
Copy link
Contributor

Thanks for the contribution; sorry for the delay.

After further review, I have decided not to deprecate ProducerListener because, unlike the ProducerInterceptor, it does not have access to the failed record in onAcknowledgment().

@viktorardelean
Copy link
Author

Thanks for the update @garyrussell !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate Producer Listener
3 participants