0
votes

We have a flink job that need to transform kafka event from type1 to type2. But during the transformation, I need to call query mysql for additional information to construct type2. MysqlConnection is not serializable, could anyone suggest what's a better way to do this ?

2

2 Answers

0
votes

Try make you connection field transient and initialize it in open method or constructor.

0
votes

Georgy's answer is the simplest approach. For better throughput and resource utilization, consider using async i/o. The documentation includes an AsyncDatabaseRequest example.