I have a few questions about using flink, just now. I would like to ask all of you to help me.
-
flink
how to initializespring
context -
flink
how to use scheduled tasks
@ codecraft @ Ali Yunqi Community @ Fan Xuan Thank you
flink
how to initialize spring
context flink
how to use scheduled tasks @ codecraft @ Ali Yunqi Community @ Fan Xuan Thank you
for question 1:
1, the basic principle is to load the context, of spring before execution in order to avoid repeated reconstruction, you can use the simple interest mode
2. For source, sink and transformation, you can use the relevant function, that inherits AbstractRichFunction to initialize spring context
3. For the destruction of spring context, register a shutdown hook to destroy
for problem 2:
see how to use timed tasks. If you only need to be similar to schedule, in ordinary spring, then problem 1 can be solved. If you want to do timing in source or sink, you probably have to implement it according to your own requirements, such as using cron4j
http://www.54tianzhisheng.cn/.
there are also many good Flink blogs here, which are worth recommending!
the corresponding code repository is located in https://github.com/zhisheng17.
.Environment 2 machines, 203204 plans to run jobmanager and taskmanager on each of these two machines. master hz203:9081 hz204:9081 slaves hz203 hz204 flink-conf.yaml jobmanager.rpc.port: 6123 rest.port: 9081 blob.server.port: 6124 query.se...
due to the current version, it seems that flink does not support dynamic scaling,. If you need to increase resource allocation, you must first stop the running job. Currently I have a flink job that is used to consume data from kafka topic and then sink ...