Skip to content

NewConnectorDefinition.config should be Map<String, Object> #55

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
MosheElisha opened this issue Jul 14, 2021 · 2 comments
Open

NewConnectorDefinition.config should be Map<String, Object> #55

MosheElisha opened this issue Jul 14, 2021 · 2 comments

Comments

@MosheElisha
Copy link
Contributor

Hi,

I believe NewConnectorDefinition.config should be Map<String, Object> instead of Map<String, String>.
This will better support non-string configuration such as tasks.max and errors.deadletterqueue.topic.replication.factor which are numbers.

Perhaps for backward-compatibility there is a need to support both somehow.

@Crim
Copy link
Collaborator

Crim commented Jul 21, 2021

I can't remember if there's a reason why I explicitly made it Map<String, String> now, but this setter seems to accept numbers without a problem:

public Builder withConfig(final String key, final Object value) {
            this.config.put(key, value.toString());
            return this;
        }

And used in this test here: https://github.com/SourceLabOrg/kafka-connect-client/blob/master/src/test/java/org/sourcelab/kafka/connect/apiclient/KafkaConnectClientTest.java#L155-L163

Is there some other use case where this is problematic?

@MosheElisha
Copy link
Contributor Author

It is not a blocker and when I send string values to numeric conf properties ("tasks.max"="1") it works fine.

The problem was that I already had a Map<String, Object> at hand and I wanted to simply pass that to the NewConnectorDefinition

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

No branches or pull requests

2 participants