Hello everyone,

coming from the Spring/CDI world, I'm new to Flink and to streaming
processing in general and apologizing for the very basic questions. I wrote
simple Flink job with all functions inlined in the main method. The main
method has some static instance variables like HTTP client and guava cache
to avoid same requests to external APIs.
Everything works fine in IDE, however after refactoring functions to
separate classes I got NotSerializableException, because obviously one
cannot inject anything into functions, unless it is serializable and guava
cache isn't.

Am I right assuming every object needed for a function must be created by
function itself?
What is the right way to instantiate the objects (constructor or in open
method of the function)?
Can functions have non-serializable fields at all?

What are the best practices to manage any dependencies in Flink programs?

Maybe you can also point me to some tutorial for the beginners?

Kind regards,
Pan

Reply via email to