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

How can I provide specific settings for kafka topic with dots in name? #28703

Closed
tinurcity opened this issue Sep 7, 2021 · 5 comments
Closed
Labels
comp-kafka Kafka Engine feature question Question?

Comments

@tinurcity
Copy link

I tried provide sass configuration for topic with name like 'team.topic', but unsuccessfully
I also tried replace dot with underscore.


broker,cgrp
<auto_offset_reset>earliest</auto_offset_reset>

<kafka_team.topic>
<security_protocol>SASL_SSL</security_protocol>
<sasl_mechanism>PLAIN</sasl_mechanism>
<sasl_username>some_sasl_username</sasl_username>
<sasl_password>some_sasl_password</sasl_password>
<ssl_ca_location>/path/to/extra_ca.crt</ssl_ca_location>
</kafka_team.topic>

@tinurcity tinurcity added the question Question? label Sep 7, 2021
@filimonov
Copy link
Contributor

XML parser used to read the configuration files don't allow to have dots in tag names.
Maybe you can just set it up globally - for all topics?

@filimonov filimonov added the comp-kafka Kafka Engine label Sep 8, 2021
@tinurcity
Copy link
Author

I have to provide two configs for two Kafka cluster (one PLAINTEXT and SASL_SSL another), and naming conventions
demand me to use dots, also we have topics for debezium (dots demanded too) =(
If I could define mask for topics, it would be great feature

@ant0nk
Copy link

ant0nk commented Mar 31, 2022

Have same problem and same situation with several Kafka clusters.

@filimonov
Copy link
Contributor

It can be done in recent releases using named collections

Like that

<!-- /etc/clickhouse-server/config.d/kafka_preset1.xml -->
<clickhouse>
    <named_collections>
        <kafka_preset1>
            <kafka_broker_list>broker1:345,broker2:345</kafka_broker_list>
            <kafka_topic_list>topic.with.dot.in.name</kafka_topic_list>
            <kafka_group_name>clickhouse_topic_group</kafka_group_name>
            <kafka>
                <security_protocol>sasl_ssl</security_protocol>
                <sasl_mechanism>SCRAM-SHA-512</sasl_mechanism>
                <sasl_username>user</sasl_username>
                <sasl_password>password</sasl_password>>
                <auto_offset_reset>smallest</auto_offset_reset>
                <ssl_endpoint_identification_algorithm>https</ssl_endpoint_identification_algorithm>
                <ssl_ca_location>probe</ssl_ca_location>
            </kafka>
        </kafka_preset1>
    </named_collections>
</clickhouse>
CREATE TABLE kafka
(
    `key` UInt64,
    `value` UInt64
)
ENGINE = Kafka(kafka_preset1, kafka_format = 'CSV')

@MahmoudElhalwany
Copy link

It can be done in recent releases using named collections

Like that

<!-- /etc/clickhouse-server/config.d/kafka_preset1.xml -->
<clickhouse>
    <named_collections>
        <kafka_preset1>
            <kafka_broker_list>broker1:345,broker2:345</kafka_broker_list>
            <kafka_topic_list>topic.with.dot.in.name</kafka_topic_list>
            <kafka_group_name>clickhouse_topic_group</kafka_group_name>
            <kafka>
                <security_protocol>sasl_ssl</security_protocol>
                <sasl_mechanism>SCRAM-SHA-512</sasl_mechanism>
                <sasl_username>user</sasl_username>
                <sasl_password>password</sasl_password>>
                <auto_offset_reset>smallest</auto_offset_reset>
                <ssl_endpoint_identification_algorithm>https</ssl_endpoint_identification_algorithm>
                <ssl_ca_location>probe</ssl_ca_location>
            </kafka>
        </kafka_preset1>
    </named_collections>
</clickhouse>
CREATE TABLE kafka
(
    `key` UInt64,
    `value` UInt64
)
ENGINE = Kafka(kafka_preset1, kafka_format = 'CSV')

Hello Bro, which version supports SASL_SSL? and if there is a version with support for IAM role let me know! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-kafka Kafka Engine feature question Question?
Projects
None yet
Development

No branches or pull requests

4 participants