how to dynamically update topics of SinkConnector in Kafka Connect? -


i have written kafka connect consumer topics, topic change @ runtime, need reconfiguration topics.

i know use restful api can update topics there way achieve this?

kafka connect intended run service, supports rest api managing connectors. way update through rest api @ run time :

put /connectors/{name}/config - update connector's configuration parameters @ run time.

request json object - config(map)  {     "connector.class": "io.confluent.connect.hdfs.hdfssinkconnector",     "tasks.max": "20",     "topics": "kafkaconnecttopic",     "hdfs.url": "hdfs://smoketest:9000",     "hadoop.conf.dir": "/etc/hadoop/conf",     "hadoop.home": "/etc/hadoop",     "flush.size": "1000",     "rotate.interval.ms": "100" }  response :  {     "name": "hdfs-sink-connector",     "config": {         "connector.class": "io.confluent.connect.hdfs.hdfssinkconnector",         "tasks.max": "20",         "topics": "kafkaconnecttopic",         "hdfs.url": "hdfs://smoketest:9000",         "hadoop.conf.dir": "/etc/hadoop/conf",         "hadoop.home": "/etc/hadoop",         "flush.size": "1000",         "rotate.interval.ms": "100"     },     "tasks": [         { "connector": "hdfs-sink-connector", "task": 1 },         { "connector": "hdfs-sink-connector", "task": 2 },         { "connector": "hdfs-sink-connector", "task": 3 }    ] } 

for further reading can go through http://docs.confluent.io/3.0.0/connect/userguide.html#connect-administration.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -