Get Started Free

Event Source

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.

Problem

How can we create Events in an Event Streaming Platform?

Solution

event-source

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 or Apache Flink® application.

Implementation

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; Flink SQL, for example, provides an INSERT statement.

CREATE TABLE temperature_readings (
    sensor_id INT,
    temperature DOUBLE,
    ts TIMESTAMP(3),
    WATERMARK FOR ts AS ts
);
INSERT INTO temperature_readings VALUES
    (0, 55, TO_TIMESTAMP('2024-11-15 02:15:30')),
    (0, 50, TO_TIMESTAMP('2024-11-15 02:20:30')),
    (0, 45, TO_TIMESTAMP('2024-11-15 02:25:30'));

References

Confluent Cloud is a fully managed Apache Kafka service available on all three major clouds. Try it for free today.

Try it for free