Guys, I'm consuming a pulsar topic using a PulsarS...
# random
m
Guys, I'm consuming a pulsar topic using a PulsarSource<String>, and do a bit processing. When I notice messages flowing in, the stream seems to be processed every 10 seconds, not continuously. Also I run the flink stream standalone, just from IntelliJ. I'm a bit lost, can anyone give me a clue why this happens?
flink 1
m
Let me ping some of the connector maintainers, because I think they can answer this one the best. They are in a different timezone so replies might be later
๐Ÿ‘ 3
m
Thanks for that. I also grokked all logs, but could not find any interesting. First I tought maybe the DataStream.print() caused it. So turned that off too.
m
Do you have checkpointing enabled?
m
Seems to be turned off. I played with that feature in the past...
m
Reason why I'm asking is because with Kafka we know that users are surprised because usually lag is measured by looking at the offsets, which in the case of Kafka are only committed when a checkpoint is made. Since Pulsar uses the same Flink APIs under the hood as a source, I thought this could be the same but I don't know Pulsar as a technology ๐Ÿ˜…
m
Hmm, it might be interesting to turn that off explicitly. Good direction to search into... For you're information: I'm processing a live stream of 'matrixborden' of the Dutch highways๐Ÿ˜‰
m
I figured with your name you must be a fellow-Dutchie ๐Ÿ˜„ that is a cool use case
Keep in mind that if you turn checkpointing off, there's no resilience pattern in case Flink crashes or needs to be restarted. But since you're running locally that won't be an issue now
m
Thanks for that. Yes, I take some steps for streams to be recoverable. But for now it's not a big deal. Later on we will incorporate live speed measurements. It's a lot of data.
Works beautifully ๐ŸŽ‰
m
It's really cool to see these type of use cases! ๐Ÿฅณ
flink 1
m
We do live detection, also running tile38 for collision detection. I'm planning to use flink for realtime geo processing. Where we can detect wheter a big truck runs into a vulnerable roadworker, and send warnings to the driver.
So we take into account distance, speed, direction.
And live joins of geo data (like whether a user is inside a polygon).
Small steps.... but getting there.
I know ArcGIS is working on realtime data too. But I think compared to Pulsar/Flink it's old tech....
m
Would it help your use case if FLINK-9219 was implemented?
m
I'm playing with Sedona too... yes this stuff really helps!
m
That's good to know
m
Sedona also has these ST_ functions... probably some overlap there.
Copy code
StreamExecutionEnvironment env = EnvironmentUtils.initEnvWithWebUI(true);
        env.setParallelism(1);

        EnvironmentSettings settings = EnvironmentSettings.newInstance().inStreamingMode().build();
        StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env, settings);

        SedonaFlinkRegistrator.registerType(env);
        SedonaFlinkRegistrator.registerFunc(tableEnv);
And then you can run those ST_ functions on tables.
m
Wondering if they also leverage Calcite under the hood
Another thing to put on my list of things to look into during a couple of days off ๐Ÿ˜„
m
The story of my live ๐Ÿ˜ณ๐Ÿคฃ
y
Hi @Merijn van Mourik . This is a known issue and get tracked in https://issues.apache.org/jira/browse/FLINK-28870. I forget to submit the PR on Flink. But we have fixed it in StreamNativeโ€™s fork. You can find the connector version for your Flink here: https://mvnrepository.com/artifact/io.streamnative.connectors/flink-connector-pulsar
๐Ÿ˜ 2
Flink 1.15.x can choose the 1.15.1.4 while Flink 1.16.x can use 1.16.0.0.
This issue only occur on small incoming messages. Feel free to use it in Production with massive messages.
๐ŸŽ‰ 2
m
I can confirm it works now! Thanks!!
I also experimented a bit with the pulsar client configuratoin options. Learning something new everytime...
๐Ÿ™Œ 2
s
Is there a channel for understanding usecases on flink? I loved to read this thanks for sharing the usecase
m
Currently this is the place to go: https://flink.apache.org/usecases.html
I'm also looking at realtime data warehousing, and ways to process changing dimensions for metadata.
๐Ÿ‘ 1
Wow, learning Flink is not for the faint-harted ๐Ÿ™‚
message has been deleted
Getting some real results now...