Jump to content

Draft:KSML (Apache Kafka)

From Wikipedia, the free encyclopedia

KSML is a wrapper around the Kafka Streams library that allows for development of low code stream processing applications. It was developed by Axual early 2021 and released as open source in May 2021. It reached 1.0 status in June 2024 and both language and functionality are now considered stable.

The source code repository can be found on GitHub.

Objective

[edit]

The idea behind KSML is to allow a user/developer to specify a streaming application in a declarative language, without having to know or write Java code. The KSML language is a mix of YAML and Python code.

A simple example application looks as follows:

 from:
   topic: input_topic
   keyType: string
   valueType: string
 via:
   - type: filter
     predicate:
       expression: key == 'key1'
 to:
   topic: output_topic

This application will read from a Kafka topic called input_topic, filter all messages that contain the key key1 (non-matching messages are dropped) and write the results to output_topic.

More examples can be found in the GitHub repository.