Register a Kafka source
If you already ran the walkthrough,orders_source is registered. Reuse it in transformations. Otherwise, edit the connection values and run this declaration once.
table_id and accepted: true. This saves the connector definition. Records are consumed when a pipeline using it starts.
Match the message schema
The declaration above reads JSON objects like this one:BIGINT holds whole-number IDs, DOUBLE holds amounts, and TEXT holds strings. The walkthrough uses JSON objects with fixed columns. Avro and Protobuf need their own matching format and schema settings.
Choose offsets and read mode
The offset option chooses a starting position when no saved Streaming checkpoint is being restored. Resuming the same pipeline uses its checkpointed offsets. Creating a different pipeline with
earliest can read the retained records again.
For group, use the explicit group ID whose stored offsets you intend to read. Share a consumer group only when that sharing is part of your Kafka design.
Connect with SASL
SASL is Kafka’s authentication mechanism. This alternative uses a secured broker and worker environment variables for its username and password. It registers a separate source; use this source name in your pipeline query.{{ KAFKA_USERNAME }} and {{ KAFKA_PASSWORD }} references use the Streaming connector’s environment expansion. Supply those variables to the Streaming processes that resolve the connection, including its workers. They are separate from Unified secret or credential names.
For AWS MSK IAM authentication, use the following option fragment inside a source declaration. It uses the runtime’s AWS identity, with an optional assumed role.
Use the source in a pipeline
TheFROM clause names the registered source. The target sink must also be registered. Your first pipeline shows the complete script.
In the current Kafka connector, type must be source. Use an Iceberg sink for the destination shown in these examples.