Skip to content

Conversation

@FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented Jun 9, 2025

In KIP-1143, it
deprecated Endpoint#listenerName and removed
org.apache.kafka.network.EndPoint. Certain parts of the code depend on
listener name normalization. We should add a test to make sure there is
no regression.

Followup: https:
//github.com//pull/19191#issuecomment-2939855317 Reviewers:
Chia-Ping Tsai chia7712@gmail.com

Signed-off-by: PoAn Yang <payang@apache.org>
) { cluster =>
cluster.format()
cluster.startup()
TestUtils.waitUntilTrue(() => cluster.brokers().get(0).brokerState == BrokerState.RUNNING,
Copy link
Member

Choose a reason for hiding this comment

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

What we want to test is to add a lower-case listener name to the broker configuration and then ensure it works. Therefore, could you please ensure the "external" is NOT converted to upper case when creating the embedded kafka? For example, you could check the value of listeners or inter.broker.listener.name within the KafkaConfig.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. I add some new assertions for listeners, inter.broker.listener.name, and listener.security.protocol.map.

@FrankYang0529 FrankYang0529 requested a review from chia7712 June 13, 2025 02:05
@chia7712
Copy link
Member

@FrankYang0529 could you please add unit test to ensure the lower case does not work for controller listener name? see #19191 (comment)

@FrankYang0529
Copy link
Member Author

@chia7712 I add a unit test testLowercaseControllerListenerNames for it. Thanks.

BrokerServer broker = entry.getValue();
ListenerName listenerName = nodes.brokerListenerName();
int port = broker.boundPort(listenerName);
int port = broker.boundPort(ListenerName.normalised(listenerName.value()));
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add comments to explain the behavior? Also, the controller listener name needs comment too.

Copy link
Member

Choose a reason for hiding this comment

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

the controller listener name needs comment too.

line#578

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated it. Thanks.

@chia7712 chia7712 merged commit a94f7ca into apache:trunk Jun 17, 2025
26 checks passed
@FrankYang0529 FrankYang0529 deleted the MINOR-add-endpoint-test branch June 17, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker small Small PRs tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants