Skip to main content

Common ingestion workflow

info

This section uses one Kafka JSON message to explain source preparation, task configuration, target queries, and verification. Connectivity checks, parsing previews, and ingestion queries check different stages and cannot replace one another. Configure point sources such as OPC UA and PI using their connector guides, not message-body parsing settings.

Where to operate: taosExplorer → Data Ingestion. Prepare target databases and tables and query ingested data in the taosExplorer Data Browser or taos CLI.

For a first Kafka, OPC UA, or PI task, start with its quick start instead of reading all connector documentation first: Write your first record from Kafka, Collect your first OPC UA point, or Backfill a historical range from PI.

1. Confirm objects and execution location​

Confirm the following before creating a task. Browser access to the source does not establish access from the collection host.

ItemInformation to establish
Source objectsTopics, points, tables, files, or historical ranges to read, and required permissions.
Execution hostFor direct access, the taosX host running the task; with a proxy, also the taosX-Agent host. Deploy source dependencies, files, and certificates on the host that actually uses them.
Target objectsTarget TDengine cluster, database, supertable, and child table naming rules.
Identities and permissionsTask management, source read, and target write permissions. If databases and tables must be created in advance, an authorized TDengine TSDB administrator does so.
Verification scopeOne test object, a small recognizable data set, and expected times, field values, tags, and record count.

Run SHOW XNODES; in the taosExplorer Data Browser or taos CLI to check nodes available for task execution. If the browser, taosX, taosX-Agent, source, and target are on different hosts, check network connectivity separately. localhost refers to the environment of the process initiating the connection, not necessarily the browser host. A container's loopback address does not refer to its host either.

If components, ports, or identities are not ready, first check software, network directions, and the task inventory using Installation and pre-deployment checks. With a proxy, first complete Agent deployment and maintenance. After the common checks, check the connector SDK, source permissions, and other prerequisites.

2. Prepare a verifiable sample​

For message ingestion, prepare a sample matching the real business format, with a device identifier, data time, and an easily checked value. For example:

{"device":"d001","ts":1795132800000,"temperature":23.5}

ts is a millisecond Unix timestamp corresponding to 2026-11-20T00:00:00Z; device is the device identifier and temperature the temperature value. This time must fall within target database retention. If changing the sample, update sent data and verification queries together.

Samples are only for designing and checking parsing and mapping configuration. Pasting JSON into the preview area does not send messages to Kafka or prove that the task consumed source data. Likewise, distinguish an uploaded preview sample from a production file import task.

Point collection does not require this JSON. Ask the source administrator for a point safe to test and record its identifier, data type, current value, and timestamp semantics. For historical backfill, first select a small range queryable in the source system and record its start, end, and time zone.

3. Configure the connection and check reachability​

Add a data source on the Data Ingestion page. Select the connector, target database, and proxy if needed. Enter connection addresses, authentication, and collection objects, then run a connectivity check.

warning

If the check fails, follow the actual execution host's network path to check addresses, ports, authentication, certificates, and source permissions. Do not disable authentication or TLS verification to bypass the issue. For Kafka, also confirm that the collection host can reach addresses returned by the brokers, not just the initial broker address.

Success means only that this connection check passed. A wrong topic or point, no new source data, an incorrect consumer position, parsing failure, or insufficient target permissions can still cause collection or writing to fail.

4. Configure target tables from parsing results​

When message-body parsing is required, first retrieve or enter a sample, select its format, and inspect the parsing preview. Do not add multiple extraction, splitting, filtering, or transformation rules at once for the first test. Confirm that data can be read and written normally, then add rules one at a time and verify again.

Check locationExpected result in this exampleIf it differs
Parsing previewRecognizes device, ts, and temperature without incorrectly splitting or losing values.Check sample completeness, character encoding, and parser. Do not change the target table to accommodate incorrect parsing.
Time mappingMaps ts to the target timestamp column, interpreted in milliseconds.Check source units and conversion settings. Handle seconds, milliseconds, and text times separately.
Value mappingMaps temperature to a DOUBLE column with sample value 23.5.Check field names, data types, and conversion rules.
Device and table nameMaps device to a tag; child table template t_{device} generates t_d001.Check that template fields exist, device identities are stable, and different devices do not map to the same child table.
Filtering resultNo filter for the first test; if filtering is needed, the test message meets the retention conditions.Test samples that should be kept and excluded separately. Do not mistake all records being filtered out for collection failure.

This example uses supertable temperatures, columns ts TIMESTAMP and temperature DOUBLE, and tag device VARCHAR(32). For database and table creation SQL and full configuration, see Write your first record from Kafka. When using an existing target table, follow its actual schema. Do not modify business tables without confirming the impact. For more samples, parsing, field processing, mapping, and error policies, see Data processing and modeling.

Connectors such as OPC UA and PI use their own point and target model settings and do not need the JSON Payload parsing in this example.

5. Start the task and check actual writes​

After submitting configuration, confirm in the task list that the task has started. If not, start the original task manually. Then send real data to the test source, or trigger collection or historical reading as described in the connector guide. Preview results do not replace actual write checks.

For the Kafka sample above, run in the taosExplorer Data Browser or taos CLI:

SELECT ts, temperature, device
FROM taosx_quickstart.t_d001
WHERE ts = 1795132800000;

Expect one row with temperature 23.5 and device tag d001. If using other database or child table names, update the query objects. The time displayed by taos CLI may depend on the host time zone. Compare the same timestamp, not just display text.

Send another message with a timestamp 1000 milliseconds later and temperature 24.5, then query its timestamp to verify continuous writing. Resending data with the same timestamp may leave target row count unchanged, so row count alone cannot establish message receipt. The task's cumulative write count is not the number of unique target table rows either.

For historical backfill, compare boundaries, counts, sampled values, and tags for the same source object and time window. Task completion does not mean data verification has passed.

6. Troubleshooting​

If no data appears on first ingestion, start with the minimal recheck in No data on first ingestion. To locate issues across the full path, check the same source record following Health checks and no-data diagnosis. For obtaining logs, metrics, and error samples, see Logs and performance. Error samples are not complete failure records and cannot serve as backups or automatic recovery inputs.

7. Save configuration and verify recovery boundaries​

After small-scope verification passes, record the task name, source objects, consumer group or collection range, target tables, and verification queries before gradually expanding the scope. To pause, stop the original task. To resume, restart the original task and check recovery with new data.

Recovery positions and source rereading capabilities differ by connector. Do not apply Kafka consumer group behavior to point subscriptions or file import. Check each connector guide for whether downtime data can be reread, which state must be preserved, and whether duplicates are possible. Before maintenance, read Restarts, checkpoints, and store-and-forward. Do not substitute cache deletion, consumer group changes, or task copying for a verified recovery procedure.