Various components in an Event Streaming Platform will generate Events. An Event Source is the generalization of these components, which can include Event Processing Applications, cloud services, databases, IoT sensors, mainframes, and more.
Conceptually, an event source is the opposite of an Event Sink. In practice, however, components such as an event processing application can act as both an event source and an event sink.
How can we create Events in an Event Streaming Platform?
Use an Event Source, which typically acts as a client in an Event Streaming Platform. Examples are an Event Source Connector (which continuously imports data as Event Streams into the Event Streaming Platform from an external system such as a cloud service or a relational database), or an Event Processing Application, such as a Kafka Streams application or the streaming database ksqlDB.
Normally, an actual component such as an application for Apache Kafka® would be writing Events into an Event Stream via a client library, API, gateway, etc. We can also write events directly using SQL syntax; the streaming database ksqlDB, for example, provides an INSERT
statement.
CREATE STREAM users (username VARCHAR, name VARCHAR, phone VARCHAR)
with (kafka_topic='users-topic', value_format='json');
INSERT INTO users (username, name, phone)
VALUES ('awilson', 'Allison', '+1 555-555-1234');