Skip to content
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

[Improve] [Connector-V2] Kafka client user configured clientid is preferred #3783

Merged
merged 2 commits into from
Dec 24, 2022

Conversation

lightzhao
Copy link
Contributor

If the clientid is configured on the user side, the clientid on the user side is preferred; otherwise, the default clientid is set.

Purpose of this pull request

Check list

…ser side is preferred; otherwise, the default clientid is set.
@Hisoka-X Hisoka-X changed the title User configured clientid is preferred [Improve] [Connector-V2] Kafka client user configured clientid is preferred Dec 22, 2022
@@ -68,7 +68,12 @@ private KafkaConsumer<byte[], byte[]> initConsumer(String bootstrapServer, Strin
properties.forEach((key, value) -> props.setProperty(String.valueOf(key), String.valueOf(value)));
props.setProperty(ConsumerConfig.GROUP_ID_CONFIG, consumerGroup);
props.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServer);
props.setProperty(ConsumerConfig.CLIENT_ID_CONFIG, CLIENT_ID_PREFIX + "-consumer-" + this.hashCode());
if(this.metadata.getProperties().get("client.id") == null){
Copy link
Member

Choose a reason for hiding this comment

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

Please format the code. thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Format code completed, thank you.

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

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

LGTM

@liugddx liugddx merged commit aacf0ab into apache:dev Dec 24, 2022
@lightzhao lightzhao deleted the set-user-clientid branch December 28, 2022 03:28
lhyundeadsoul pushed a commit to lhyundeadsoul/incubator-seatunnel that referenced this pull request Jan 3, 2023
…ferred (apache#3783)

* If the clientid is configured on the user side, the clientid on the user side is preferred; otherwise, the default clientid is set.

* format code style

Co-authored-by: zhaoliang01 <zhaoliang01@58.com>
lhyundeadsoul pushed a commit to lhyundeadsoul/incubator-seatunnel that referenced this pull request Jan 3, 2023
…ferred (apache#3783)

* If the clientid is configured on the user side, the clientid on the user side is preferred; otherwise, the default clientid is set.

* format code style

Co-authored-by: zhaoliang01 <zhaoliang01@58.com>
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.

None yet

4 participants