confluentinc / kafka-connect-datagen

Connector that generates data for demos
Apache License 2.0
20 stars 87 forks source link

Sample configs format for max.interval and iterations is incorrect #95

Open daveshook opened 3 years ago

daveshook commented 3 years ago

The sample configs specify max.interval and interations incorrectly, e.g., "max.interval": 100, and "iterations": 10000000,. These need to be specified as string values, e.g., "max.interval": "100", and "iterations": "10000000",.

ybyzek commented 3 years ago

@daveshook is this a difference between CCloud connector config using Confluent CLI and on-prem local connector config using curl

daveshook commented 3 years ago

I spoke too soon. I tested on-prem local connector config using curl that included "max.interval": "100", and "iterations": "10000000",. This succeeded. Based upon my CCloud experience, I assumed using "max.interval": 100, or "iterations": 10000000, would result in an error but did not verify this. I just did a fresh test and both options work. When specifying either of these settings without the surrounding quotes, the command output shows them with surrounding quotes.

$ curl -X POST \
>   -H "Content-Type: application/json" \
>   --data '{
>   "name": "DatagenConnectorConnector_0",
>   "config": {
>     "name": "DatagenConnectorConnector_0",
>     "connector.class": "io.confluent.kafka.connect.datagen.DatagenConnector",
>     "tasks.max": "1",
>     "kafka.topic": "transactions",
>     "max.interval": 10,
>     "iterations": 10000,
>     "quickstart": "transactions"
>   }
> }' http://connect:8083/connectors
{"name":"DatagenConnectorConnector_0","config":{"name":"DatagenConnectorConnector_0","connector.class":"io.confluent.kafka.connect.datagen.DatagenConnector","tasks.max":"1","kafka.topic":"transactions","max.interval":"10","iterations":"10000","quickstart":"transactions"},"tasks":[],"type":"source"}

So the sample configs will work as is with the on-prem local connector config using curl. Their not being enclosed in quotes in the sample configs is just a nit. @ybyzek please close the issue unless you feel the nit is worthy of fixing.