java - Poll Interval for Kafka Connect SourceTask -


i'm implementing custom source connector using kafka-connect api, can used poll rest-apis , sink json response kafka topic. i'm wondering how realize polling interval sourcetask, how jdbc connector offers one. somewhere have set thread sleep, have this?

i solved use case in sourcetask implementation adding private field of type long store time stamp. @ first poll() invocation field not yet initialized, therefore configured rest-apis polled. while first invocation mentioned long field get's initialized current time stamp. in following poll() invocations time stamp of previous invocation get's checked. if amount of elapsed milliseconds since previous poll() smaller configured interval between 2 polls, send thread sleep since configured milliseconds elapsed.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -