Search code examples
ksqldb

How to insert into stream programmatically?


There are several messages from producer that I receive and I need to store them in to the stream but I don't want to do it manually from ksqldb console and need to handle those insertions via programming (Python/Java). Could anybody show me a sample code or any reference? Thanks!


Solution

  • you can use the REST APIs or the Java client to interact with ksqlDB. Here's the doc for Java client with code snippet for insert: https://docs.ksqldb.io/en/latest/developer-guide/ksqldb-clients/java-client/#stream-inserts.