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
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ public void setDefaultTopic(String defaultTopic) {
* a send operation. By default a {@link LoggingProducerListener} is configured
* which logs errors only.
* @param producerListener the listener; may be {@code null}.
* @deprecated in favor of {@link #setProducerInterceptor(ProducerInterceptor)}
* @see #setProducerInterceptor(ProducerInterceptor)
*/
@Deprecated(since = "3.0", forRemoval = true)
public void setProducerListener(@Nullable ProducerListener<K, V> producerListener) {
this.producerListener = producerListener;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 the original author or authors.
* Copyright 2018-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -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

*/

@Deprecated(since = "3.0", forRemoval = true)
public class CompositeProducerListener<K, V> implements ProducerListener<K, V> {

private final List<ProducerListener<K, V>> delegates = new CopyOnWriteArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2021 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -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)
public class LoggingProducerListener<K, V> implements ProducerListener<K, V> {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,11 @@
* @author Endika Gutiérrez
*
* @see org.apache.kafka.clients.producer.Callback
*
* @deprecated since 3.0 in favor of {@link org.apache.kafka.clients.producer.ProducerInterceptor}
*/

@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.

public interface ProducerListener<K, V> {

/**
Expand Down