Read configuration instead of hard code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Read configuration instead of hard code

ZalaCheung
Hi all,

I use Kafka as the source of my data stream. Instead of specifying the host and topic of Kafka directly in code, is that possible to read the configuration including Kakfa info from somewhere else like file or database?

 Desheng Zhang

E-mail: [hidden email];

Reply | Threaded
Open this post in threaded view
|

Re: Read configuration instead of hard code

Timo Walther
Hi Desheng,

Flink programs are defined in a regular Java main() method. They are executed on the Flink Client (usually the JobManeger) when submitted, you can add arbirary additional logic (like reading a file from an NFS) to the code. After retrieving the Kafka Info you can pass it to the Flink connector constructor.

Regards,
Timo


Am 13.07.17 um 13:43 schrieb ZalaCheung:
Hi all,

I use Kafka as the source of my data stream. Instead of specifying the host and topic of Kafka directly in code, is that possible to read the configuration including Kakfa info from somewhere else like file or database?

 Desheng Zhang

E-mail: [hidden email];