/flink-scala-3

A collection of Flink examples with Scala 3, but without the deprecated Scala API

Primary LanguageScala

Flink API examples for DataStream API and Table API in Scala 3

As of 1.15+ Flink does not expose any specific Scala version anymore. Users can now choose whatever Scala version they need in their user code, including Scala 3.x. Note that the Scala API is not used, since it is deprecated. As of 1.16+ there are no feasible alternatives. Successor candidates are:

This repository is a fork of Flink Scala 3 examples, which is originally based on Timo Walther's Flink API Examples for DataStream API and Table API. You can watch his talk Flink's Table & DataStream API: A Perfect Symbiosis on YouTube which walks through the Java version of this code.

Additional Scala examples:

This Repo contains also some Java examples:

Other interesting Flink examples: Immerok examples Repo

How to Use This Repository

  1. Import this repository into your IDE (preferably IntelliJ IDEA). The project uses the latest Flink version and runs with Java 11.

  2. In IDEA Project structure | Global libraries add the corresponding scala-sdk, eg 3.3.x

  3. All examples are runnable from the IDE or SBT. Execute the main() method of every example class.

  4. For the Apache Kafka examples, start up Kafka and Zookeeper:

cd docker
docker-compose up -d
  1. Run FillKafkaWithCustomers and FillKafkaWithTransactions to create and fill the Kafka topics with data.

  2. Monitor the Kafka topics with local akhq console