Skip to content

KAFKA-18760: Deprecate Optional<String> and return String from public Endpoint#listener #19191

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

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from

Conversation

FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented Mar 12, 2025

  • Deprecate org.apache.kafka.common.Endpoint#listenerName.
  • Add org.apache.kafka.common.Endpoint#listener to replace
    org.apache.kafka.common.Endpoint#listenerName.
  • Replace org.apache.kafka.network.EndPoint with
    org.apache.kafka.common.Endpoint.
  • Deprecate org.apache.kafka.clients.admin.RaftVoterEndpoint#name
  • Add org.apache.kafka.clients.admin.RaftVoterEndpoint#listener to
    replace org.apache.kafka.clients.admin.RaftVoterEndpoint#name

Reviewers: TaiJuWu [email protected], TengYao Chi
[email protected], Chia-Ping Tsai [email protected]

@FrankYang0529 FrankYang0529 changed the title KAFKA-18760: Deprecate Optional<String> and return String from public EndPoint#listenerName (wip) KAFKA-18760: Deprecate Optional<String> and return String from public Endpoint#listener (wip) Apr 15, 2025
@FrankYang0529 FrankYang0529 changed the title KAFKA-18760: Deprecate Optional<String> and return String from public Endpoint#listener (wip) KAFKA-18760: Deprecate Optional<String> and return String from public Endpoint#listener Apr 15, 2025
Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@FrankYang0529 thanks for this patch

/**
* @deprecated Since 4.1. Use {@link #listener()} instead. This function will be removed in 5.0.
*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

@Deprecated(since = "4.1", forRemoval = true)

*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

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

@Deprecated(since = "4.1", forRemoval = true)

public class Endpoint {

private final String listenerName;
private final SecurityProtocol securityProtocol;
private final String host;
private final int port;

public static String parseListenerName(String connectionString) {
Copy link
Member

Choose a reason for hiding this comment

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

it seems only KafkaConfig uses this helper. Could you please move it to the KafkaConfig instead of leaving it in this public APIs?

* Returns the listener name of this endpoint.
*/
public String listener() {
return listenerName;
Copy link
Member

Choose a reason for hiding this comment

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

How about renaming it to listenerName for consistency?

Copy link
Collaborator

@TaiJuWu TaiJuWu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this patch.

@chia7712
Copy link
Member

@FrankYang0529 please fix the conflicts

@chia7712
Copy link
Member

@FrankYang0529 please fix the conflicts

@chia7712
Copy link
Member

@FrankYang0529 please rebase code to include the fix

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

Successfully merging this pull request may close these issues.

5 participants