Konstantin -
03/06/2024, 6:43 AMlorenzo affetti
03/06/2024, 8:48 AMkafka = KafkaConsumer(...)
msgs: List<Message> = kafka.consumeTopic(...)
then, obtain a data stream from it with Flink (now, in Java):
ds = env.fromCollection(msgs)
Clearly all messages would be in memory π
Does this answer your question?Konstantin -
03/06/2024, 8:49 AMlorenzo affetti
03/06/2024, 11:58 AMKonstantin -
03/08/2024, 9:49 AMbroadcast value in BroadcastProcessFunction.
How can I grantee that broadcast state will be in place before the first element in processElement came?
I don't see any mention of thisKonstantin -
03/08/2024, 9:51 AMKonstantin -
03/08/2024, 9:53 AMMapStateDescriptor, but it can't support default value unfortunallylorenzo affetti
03/19/2024, 7:59 AMkafka = KafkaConsumer(...)
msgs: ListMessage = kafka.consumeTopic(...)
class MyProcessFunction extends ProcessFunction {
private ListMessage msgs;
public MyProcessFunction(ListMessage messages) {
msgs = messages
}
@Override
void processElement(...) {
// your logic
}
}
...
someStream.process(new MyProcessFunction(msgs))
...
At this point you would be 100% sure the process function object gets initialized with the preloaded values before the first element comes.
However, you must ensure Message is Serializable, and you will find a higher initialization time for the serde of the messages.Konstantin -
03/19/2024, 9:56 AMlorenzo affetti
03/19/2024, 3:49 PM