Skip to main content

Kafka

Kafka ingestion reads and parses topic messages, then writes them to TDengine. This page uses a temperature message to demonstrate configuration and verification, with a focus on consumer positions. A Broker connection from the UI does not mean the collection host can connect. For a quick trial, see Write the first record from Kafka.

Navigation: taosExplorer → Data In → Create New Task → Kafka. Create databases and tables and query ingested data in taosExplorer's Data Browser or the taos CLI. For first-time access, open the deployed address as described in Log in to taosExplorer.

Data flows from Kafka → taosX → TDengine. When an Agent is used, the selected taosX-Agent reads Kafka. Browser access to the Broker does not mean the collection host can access it. Publishing TDengine data to Kafka is a separate task; see Publish to Kafka.

1. Prerequisites​

CheckPreparationPassing condition
TDengine environmentThe cluster, taosExplorer, and taosX are running, with at least one Xnode online.Log in to taosExplorer and run SHOW XNODES; in its Data Browser or the taos CLI to see an online node.
Execution locationUse the taosX host for direct reads. For proxy mode, first complete Agent deployment and maintenance.Identify the actual reading host. In proxy mode, the selected Agent is online.
Kafka addressesA set of Broker hosts and ports in the same cluster, plus their advertised addresses.The actual reading host can resolve and access the bootstrap Brokers and the Broker addresses returned by the cluster.
Topics and permissionsA dedicated test topic, read permissions, and consumer-group permissions. Sending test messages also requires topic write permission.The Kafka administrator confirms that the objects exist and are readable, and the producer can send messages.
Authentication and encryptionA SASL mechanism and identity; for TLS, a CA and, when required, a client certificate and private key.Materials match the Broker configuration and are usable by the collection process. Do not bypass checks by disabling authentication.
Consumer groupA new dedicated consumer group. Do not join a production group without confirmation.No unintended partition sharing with existing business consumers. Record the group name actually saved.
Target modelA test database, supertable, target write permissions, and table-creation permissions required by the policy.The table schema can be queried, and the task identity has the required permissions.
note

For common port directions and checks, see Installation and pre-deployment checks. TCP connectivity is only a network check; it does not prove successful Kafka authentication or topic authorization.

1.1 Prepare a test Kafka environment with Docker (optional)​

If Kafka already exists, skip this section and use the addresses, topic, and authentication supplied by the Kafka administrator. This section prepares a single-node, unauthenticated Kafka only for isolated practice, not production deployment. taosX and Docker must run on the same host. If taosX runs on another host or in a container, these loopback addresses cannot be used unchanged.

Run the commands below in Bash on the Linux host running taosX. Docker Engine must be running and the execution account authorized to use Docker. If elevation is needed, follow organizational policy; do not bypass authorization by changing Docker socket permissions.

docker version

docker version must return both Client and Server information. If it returns only Client information or cannot connect to the Docker service, resolve the Docker environment first.

Confirm that container name taosx-kafka-demo and host port 19092 are unused, then run these commands in order. Each command is one complete line and works in PowerShell and Bash:

docker pull apache/kafka:3.9.1
docker run -d --name taosx-kafka-demo -p 127.0.0.1:19092:9092 -e KAFKA_NODE_ID=1 -e KAFKA_PROCESS_ROLES=broker,controller -e KAFKA_LISTENERS=HOST://:9092,INTERNAL://:29092,CONTROLLER://:9093 -e KAFKA_ADVERTISED_LISTENERS=HOST://localhost:19092,INTERNAL://localhost:29092 -e KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=HOST:PLAINTEXT,INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT -e KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL -e KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER -e KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:9093 -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 -e KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 -e KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 apache/kafka:3.9.1
docker logs --tail 30 taosx-kafka-demo
docker exec taosx-kafka-demo /opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:29092 --create --topic taosx_quickstart --partitions 1 --replication-factor 1
docker exec taosx-kafka-demo /opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:29092 --describe --topic taosx_quickstart

Wait for logs to confirm Kafka startup before creating the topic. If it is not ready, inspect logs and retry creation. The last command must show topic taosx_quickstart, one partition, and one replica. If the topic already exists, do not delete it or assume it has no historical messages. First check whether this is a retained practice environment. If image pulling fails, check network access or use an organization-approved registry. Do not disable TLS verification.

taosX uses localhost:19092; the producer inside the container below uses localhost:29092. These addresses belong to different runtime layers and are not interchangeable. The exposed port binds only to the Docker host's 127.0.0.1, without authentication or a volume for long-term data storage. After the exercise, stop the ingestion task first, then stop the container with docker stop taosx-kafka-demo. To retain progress, do not delete the container, consumer group, or target database.

1.2 Prepare the target database and supertable​

In this example, an authorized TDengine TSDB administrator creates the database and supertable in advance. With the taosExplorer Data Browser, log in to the target cluster and execute the SQL below directly; taos CLI installation is unnecessary. Alternatively, use taos CLI on a host where it is installed to connect to the target cluster.

For taos CLI, use the login command for the platform below. These commands apply only to isolated test environments where the default password has not been changed. In production, use an authorized account and enter the password at the prompt, not in command history.

Run in Bash, with taos CLI installed and in PATH:

taos -h localhost -P 6030 -u root -p

At the password prompt, enter default password taosdata, or the actual password if it has changed. Here, localhost:6030 refers to target taosd on the taos CLI host. For remote access, use the target host and actual port, and ensure the node addresses returned by the cluster are reachable.

Run the following SQL in the taosExplorer Data Browser or taos CLI. If objects with these names exist, use new dedicated test names and update the task and queries. Do not overwrite existing objects:

SHOW XNODES;
CREATE DATABASE taosx_quickstart PRECISION 'ms';
CREATE STABLE taosx_quickstart.temperatures
(ts TIMESTAMP, temperature DOUBLE)
TAGS (device VARCHAR(32));
DESCRIBE taosx_quickstart.temperatures;

Confirm at least one Xnode is online and the supertable contains ts TIMESTAMP, temperature DOUBLE, and tag device VARCHAR(32). If table creation fails, resolve permissions or object conflicts before creating a collection task.

tip

The following steps use taosx_quickstart for both the topic and database. If using an existing Kafka deployment or another target database, replace the configuration, send commands, and queries consistently, not just in one place. To prepare target objects in the UI, follow Create the target database and supertable. Choose either preparation method.

2. Create a task and complete minimal ingestion​

2.1 Add a data source​

On the Data In page, click Create New Task.

Create New Task button on the Data In page

Enter quickstart_kafka as the name, select Kafka as the type, and select taosx_quickstart as the target database. Leave Agent unselected for direct reads. If an Agent is required, select a taosX-Agent that passed the prerequisite checks.

Completed Kafka task configuration for quickstart_kafka and target database taosx_quickstart

2.2 Connect to Kafka​

Enter the host and port in the bootstrap-server field as 主机:端口. If taosX and the Docker environment above run on the same host, enter localhost:19092. Separate multiple Brokers with commas, for example broker1:9092,broker2:9092; they must belong to the same cluster. Do not enter a full DSN in this field.

bootstrap-server configuration and connectivity result for Kafka task quickstart_kafka

The isolated Docker environment does not enable SASL/SSL. For an existing Kafka deployment, follow Authentication and certificates. Do not disable production authentication to copy this exercise.

2.3 Configure collection​

  1. Enter taosx_quickstart as the topic and a recognizable client ID, such as quickstart_client_01.
  2. Enter a new dedicated consumer group ID, such as quickstart_kafka_01. Explicitly entered Client IDs and group names are saved unchanged. Automatically generated initial client suggestions can be edited; this entry point has no switch to append the task ID. During troubleshooting, still check saved values rather than deriving the consumer group from the client ID.
  3. Explicitly select Earliest for Offset, set the timeout to 0 ms to wait continuously for messages, and select UTF_8 as the character encoding.
  4. Click Check Connectivity. The result should indicate that the data source is available. If it fails, use this page's troubleshooting steps before submitting.

Completed Kafka collection settings and successful connectivity message

2.4 Parse and map the test message​

Expand Payload Transformation and enter the following JSON in the message body field. Alternatively, upload a line-delimited JSON file as described in Kafka file samples, or click Retrieve from Server if the topic already contains an approved sample. Start with one sample to avoid mistaking the preview scope for the production consumption scope.

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

JSON parsing and rule-block configuration for a Kafka temperature sample

  1. Select json under Parsing and click the preview icon for that stage. One row should be identified with device, ts, and temperature. Confirm that ts and temperature are numeric and device is a string. If no columns appear or text is garbled, correct the message body and encoding before configuring the target.
  2. Keep one rule in Rule Blocks, with Match Expression set to true. All messages in this example have the same structure. For topics with multiple structures, configure separate matching conditions as described below.
  3. Do not add Extract or Split from Columns or Filter for this example. When needed, add rules using Extraction, splitting, filtering, and transformation and preview samples that should be retained and excluded separately.
  4. Under Mapping, select the target supertable temperatures and enter t_{device} as the child-table template. Map source ts in milliseconds to the primary timestamp column, source temperature to a DOUBLE data column, and source device to a tag.
  5. Click the mapping preview. It should generate t_d001, with temperature 23.5, device d001, and a timestamp corresponding to the millisecond value below. If a value is null or a target type is incorrect, check the previous stage first. Do not substitute a default zero or the current time.

The image above uses the same temperature sample for JSON parsing; the images below show its target mapping. Select the target database and complete the parsing preview before selecting a supertable. ts appears as TIMESTAMP(ms), and temperature and device map to the column and tag with the same names:

Completed temperature sample mapping with temperatures, child-table template, and three business fields

Temperature mapping preview generating t_d001 with its timestamp, temperature, and device

2026-11-20T08:00:00+08:00 in the preview and 2026-11-20T00:00:00Z refer to the same instant. For compatible template syntax and other mapping rules, see Minimal mapping and expressions.

1795132800000 means 2026-11-20T00:00:00Z. Before writing real data, confirm that this instant is within the target database's retention period. Otherwise, use a millisecond value within retention and update the sample, send commands, and queries together. The client's time zone affects the displayed timestamp text, not the instant represented by this integer.

Check advanced options and error policies in section 3, then click Submit. Return to the task list, find quickstart_kafka, and confirm it has started. If not, start the original task rather than creating another. Expand task activity to view errors and execution details. Entering a preview sample does not send a message to Kafka.

With this page's Docker environment, send the first message on the Docker host without installing separate Kafka command-line tools:

printf '%s\n' '{"device":"d001","ts":1795132800000,"temperature":23.5}' | docker exec -i taosx-kafka-demo /opt/kafka/bin/kafka-console-producer.sh --bootstrap-server localhost:29092 --topic taosx_quickstart

If the command fails, resolve container, topic, or connection issues first. Even without an error, confirm ingestion with the target queries below. For existing Kafka, use a producer with write permission to send the same message to the selected test topic with that environment's authentication settings. Do not use Docker-internal addresses.

3. Check each setting before production use​

3.1 Authentication and certificates​

Obtain the mechanism, identity, and authorization scope from the Kafka administrator. SASL provides authentication, while TLS provides transport encryption. Using SASL does not mean the connection is encrypted.

Authentication mechanismUI fieldsChecks
PLAINUsername and password.The identity needs topic and consumer-group permissions. Configure production transport protection as required by the Broker.
SCRAM-SHA-256Username and password.Match the mechanism configured by the Kafka administrator; do not mix SCRAM mechanisms.
GSSAPIKerberos service name, principal, optional initialization command, and keytab file.The collection environment also needs the corresponding Kerberos client, realm configuration, DNS, and time synchronization.
View the username/password authentication fields

Kafka PLAIN username and password settings

Kafka SCRAM SHA256 username and password settings

The four GSSAPI items are:

ItemMeaning and provider
Kerberos service nameThe Kerberos service name for Kafka, usually kafka, confirmed by the Kafka administrator.
Kerberos principalThe principal authorized to access Kafka, not a TDengine user. Enter the full name supplied by the administrator.
Kerberos initialization commandEnter only if customization is needed, and have the administrator review it. It runs in the actual reading environment.
Kerberos keytabThe keytab for the principal, provided through the UI file input and managed as a sensitive file.

Locations of the four Kafka GSSAPI settings

First have the Kafka administrator verify that the same identity can consume the dedicated test topic from the actual reading host, then test taosX. For Server ... not found in Kerberos database, check the relationship between advertised Broker hostnames, DNS, and service principals. The Kerberos administrator determines reverse-resolution policies in krb5.conf. Do not treat changing rdns as a universal fix.

3.1.1 Check GSSAPI with an independent client​

This step separates Kafka/Kerberos environment issues from taosX configuration issues. Have the administrator prepare kcat with GSSAPI support, a Kerberos client, a restricted-permission keytab, and a dedicated test topic and consumer group. Standard kcat packages may not have the same authentication capabilities. These commands are only for authorized testing, not experiments in production consumer groups. A successful kcat check does not prove ingestion by taosX.

Run on the Linux taosX or taosX-Agent host that actually reads Kafka. If the Kerberos client is not installed, have the host administrator install it for the distribution and repositories: commonly krb5-user on Debian/Ubuntu or krb5-workstation on RHEL-family systems. Do not install it only on the browser host. Check /etc/krb5.conf, DNS, time synchronization, and the running identity's read permission for the keytab. Do not copy the keytab to an ordinary shared directory.

The following assumes the test topic already contains one sanitized message. Replace the variables with administrator-provided values first. The keytab path belongs to this Linux host, and the principal must include the actual Realm:

kafka_broker='broker.example.com:9092'
kafka_topic='taosx_gssapi_test'
kafka_group='taosx_gssapi_check_01'
kafka_principal='taosx-reader@EXAMPLE.COM'
kafka_keytab='/etc/taos/credentials/taosx-reader.keytab'

kinit -t "$kafka_keytab" -k "$kafka_principal"
klist -s

kcat -b "$kafka_broker" -G "$kafka_group" "$kafka_topic" -c 1 \
-X security.protocol=SASL_SSL \
-X sasl.mechanism=GSSAPI \
-X sasl.kerberos.service.name=kafka \
-X sasl.kerberos.principal="$kafka_principal" \
-X sasl.kerberos.keytab="$kafka_keytab" \
-X ssl.ca.location=/etc/taos/credentials/kafka-ca.pem \
-X auto.offset.reset=earliest \
-X enable.auto.commit=false \
-X allow.auto.create.topics=false

This example uses SASL_SSL. The administrator must also provide the CA file on the actual execution host. If the source listener provides only SASL_PLAINTEXT, have the administrator confirm whether testing without TLS is allowed before changing security.protocol and removing the CA option. Do not change production Broker security settings to copy the command. Replace the service name too if it is not kafka. kcat's sasl.kerberos.* names are tool-specific configuration names, not taosX DSN keys.

-G is followed by the dedicated group name and topic; -c 1 exits after receiving one message. Without messages, it may keep waiting; stop it with Ctrl+C. The command disables automatic commits and topic creation, but still joins the test group and reads messages, so obtain authorization first. Use a new test group to avoid existing offsets preventing earliest from taking effect. After stopping, do not simply replace the test group with a production group and continue experimenting.

The Linux example runs kinit first, then uses klist -s to check for valid tickets in the current ticket cache. This precheck passes only if the latter exits with code 0; it normally does not print ticket contents. kinit creates or updates tickets and is not read-only. The administrator should run it in an authorized environment using the actual collection identity and a consistent Kerberos environment. If an isolated cache is needed, configure it according to host security policies without affecting other workloads' tickets. After the precheck, kcat still independently verifies the explicitly supplied principal and keytab. Success in one does not prove success in the other.

After receiving a message, confirm that its topic and content match the test sample, then configure taosX with the same principal and materials and verify ingestion as described here. On failure, follow this order rather than repeatedly changing the target model:

SymptomNext step
The client reports no GSSAPI supportCheck kcat/librdkafka build capabilities and Kerberos dependencies; resolve the client environment first.
Principal or keytab authentication failsHave the Kerberos administrator check the principal, keytab, file permissions, and tickets. Do not attach keytabs to tickets.
The Kafka service principal cannot be foundCheck the relationship between connection hostname, advertised Broker address, service name, and SPN. Handle DNS and reverse resolution according to realm policies.
Topic or Group authorization failsHave the Kafka administrator check permissions for the test topic and dedicated group. Authentication success does not imply consumption authorization.
No error, but the client keeps waitingConfirm that the test topic contains messages and check the test group's offsets and partition assignment. Waiting without messages does not by itself indicate authentication failure.

When enabling SSL, upload a trusted CA as required by the source. Mutual TLS also requires a client certificate and private key. ca_password, shown as CA Password in the UI, is actually the client private-key passphrase, not a general CA-file decryption password. Fill it in only when the source requires a private-key passphrase.

For TLS hostname-verification limitations in the Kafka reading entry point and GSSAPI file-path rules, see DSNs and connector parameters. If strict endpoint identity verification is required, confirm the delivery solution first. Connection success does not replace security verification.

Kafka SSL certificate and private-key configuration

The upload input, file paths in taosx run, and directories on remote hosts are different concepts. Files must be usable by the actual reading environment according to that entry point's rules. Do not treat a browser-host path as an Agent path, or upload private keys or keytabs to support tickets. For sensitive-file management, see TLS, DSNs, and sensitive files.

3.2 Topics, clients, and consumer positions​

ItemMeaning and configuration requirements
TopicsEnter one or more topics, separated by commas. They must belong to the configured Kafka cluster and use compatible parsing rules.
Client IDIdentifies the Kafka client for source-side identification and troubleshooting. Matching Client IDs are not a condition for partition load balancing.
Consumer group IDConsumers in the same group share subscribed partitions and generally do not each receive every message. Use different groups for independent complete reads. Explicitly enter a dedicated group name and use the task's actual full group name when querying offsets. Do not derive it from the client ID or an assumed prefix.
EarliestStarts at the earliest retained position when an initial or fallback position is needed. It does not guarantee overriding the original group's committed offsets.
LatestStarts at the latest position when an initial or fallback position is needed. A new group may skip messages that existed before it was created.
TimeoutA no-message wait timeout can end collection; 0 ms means wait continuously. A finite wait does not mean historical data is fully read and is not a target connection timeout.
Fetch waitControls Kafka fetch-request waiting, separately from the no-message exit timeout. In a direct DSN, fetch_max_wait_time defaults to 500 ms. Specify a unit when setting it, such as 100ms. Do not mix UI values with direct-DSN defaults.
Character encodingMatch the actual message body: UTF_8, GBK, GB18030, or BIG5. This example explicitly selects UTF_8; check a real sample for garbled text first.

The UI provides Earliest and Latest for Offset, not a time-based starting position. Configure fetch wait with fetch_max_wait_time in a direct DSN; there is no UI field with that name.

The UI's initial Offset differs from the behavior of a direct DSN without fallback_offset. Explicitly specify the required position in a direct DSN too. Changing Offset does not reset Kafka's committed offsets. Do not delete production groups or rename groups for unapproved historical replay.

3.2.1 Verification example for partition sharing across instances​

Assume a dedicated test topic has 12 partitions, and the deployment plan requires three collection instances in the same dedicated consumer group, each with read_concurrency=4. The three instances create at most 12 reading consumers, and Kafka assigns partitions within the group. Client IDs can use different recognizable names; they do not participate in this sharing. Do not create three different consumer groups for “high availability”: each group may read the entire topic and produce duplicate writes to the target.

Verification pointAction and expectation
All three instances are stableUse Kafka administrator tools to inspect the actual group's partition assignment. All 12 partitions should have consumers in the same group. Check task logs and target data, not just whether three processes are online.
Stop one instanceStop one instance in an authorized test and wait for rebalancing. Surviving instances in the same group should take over its partitions. Continue sending uniquely identifiable test messages and check the target.
Restore the instanceObserve reassignment and backlog changes. Check for missing and duplicate data by message ID, business primary key, and time window. Do not promise exactly-once failover.

If the topic has only 2 partitions, setting read concurrency to 4 on each instance does not create 12 assignable partitions. read_concurrency only limits the reading instances created by this task; other consumers in the group still participate in assignment. Consumers in excess of the partition count may have no partitions. Record the actual topic partition count, full group name, assignment results, and stop time. Matching Client IDs, an increasing target row count, or normal task status do not replace this evidence.

3.3 Multiple message structures​

When a topic contains multiple structures, parse the message body first, then add a rule block for each structure:

  1. Prepare sanitized normal, missing-field, and nonmatching samples for each structure.
  2. Set each block's Match Expression to identify that structure. The default true matches directly; do not use it unchecked for all different structures.
  3. Configure the required extraction, filtering, and target mapping within each block, and preview each separately. Blocks can be added or removed. Control total configuration size using the byte limit in Constraints and boundaries, not a fixed rule count.
  4. Send each sample type to the real test topic and check its target table, record count, and values. Also check whether multiple rules process a sample unintentionally.

The following image shows shared parsing and a single rule block in a new form, with Add Rule Block at the bottom. For multiple structures, add blocks there and preview each separately.

Kafka shared parsing, single rule block, and Add Rule Block control

For file input, see Kafka file samples; for JSON objects and arrays, see Message parsing; for splitting, see Extraction and splitting; for filter conditions, see Filter records; and for models and expressions, see Target mapping.

3.4 Advanced options and write-error policies​

Do not increase concurrency or batch size before the minimal path passes verification. Adjust read concurrency, batches, and write queues one setting at a time under the same load, following Tuning and resource control. Do not apply other connectors' defaults to Kafka.

Kafka advanced settings for batches, read/write concurrency, and health monitoring

In a new form, Maximum Read Concurrency initially shows 0, leaving the collector to determine it; Batch Size is 1000. Write Concurrency is a separate option, not the Kafka partition count or number of consumers in a group. Keep initial values for the first configuration. Record throughput, latency, and source/target load before and after each change. Check actual health-threshold behavior and metric retrieval in the operations chapter; they are not a data-completeness guarantee.

In a direct DSN, read concurrency and batching use read_concurrency, batch_size, and batch_timeout. For zero values, units, defaults, and environment overrides, see Kafka read parameters. batch_timeout uses integer milliseconds, not 500ms; it is not an alias for timeout or Broker fetch wait. Adjust only settings confirmed to take effect through the current entry point. Do not apply every shared key accepted by other sources to Kafka.

Before submitting, define handling for parsing failures, missing tables, null timestamps, overlong fields, and target connection errors. Archives are diagnostic samples, not backups of every failed record. Discarded data is not automatically recovered just because the task keeps running. For full definitions and inspection methods, see Write errors and exception data and Logs and performance. Obtain permissions and model-change approval before allowing automatic table or column creation.

Check Kafka consumer positions separately from target error policies. Do not assume the original task automatically replays archived or discarded messages. Keep the millisecond semantics of ts for the first test; do not use “current time” to hide a missing source field. Preview each message structure separately before saving.

4. Verification​

Run in taosExplorer's Data Browser or the 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 the table or record is missing, check each layer in the next section. Task status does not prove successful ingestion.

Send the second message on the same Docker host. Its timestamp is 1000 milliseconds later than the first and its temperature is 24.5, to verify continuous consumption:

printf '%s\n' '{"device":"d001","ts":1795132801000,"temperature":24.5}' | docker exec -i taosx-kafka-demo /opt/kafka/bin/kafka-console-producer.sh --bootstrap-server localhost:29092 --topic taosx_quickstart

For an existing Kafka deployment, send the second sample using the original producer. Then run in taosExplorer's Data Browser or the taos CLI:

SELECT ts, temperature, device FROM taosx_quickstart.t_d001
WHERE ts IN (1795132800000, 1795132801000)
ORDER BY ts;

Expect two rows with temperatures 23.5 and 24.5 in order, both with device tag d001. Rewriting the same primary key does not necessarily increase the target's unique row count. Messages read, cumulative writes, and unique rows are different measures.

Small-scope production verification must also cover actual multiple partitions, every message structure, late data, and required authentication. Use the read-only commands in Kafka consumer-group positions and Lag to view committed positions, log-end positions, and group members for each partition. If Lag keeps increasing, use logs and metrics to locate read, processing, or write backlogs. Lag reaching zero is insufficient; also confirm that all data is correctly stored.

5. Troubleshooting​

SymptomCheck order and next step
Connectivity check failsCheck bootstrap addresses, ports, and authentication on the actual taosX or Agent host. Check source-side rejection records rather than testing ports only from the browser host.
Initial connection succeeds, then connections keep failingCheck all advertised Kafka Broker addresses, DNS, certificate hostnames, and network paths. Changing the bootstrap address cannot fix unreachable advertised addresses.
SASL or Kerberos authentication failsCheck the mechanism, source principal, and topic/group permissions. For GSSAPI, also check the keytab, service name, realm configuration, and time. Recreating TDengine users does not replace source authentication.
Preview works, but no target records appearConfirm messages were actually sent to the subscribed topic, then check the actual consumer group's partition assignment, Offset, and matching/filtering rules for each structure.
Only some messages are ingestedCheck other consumers in the group and matching/filtering results for each structure. Query the target by partition and sample rather than only increasing concurrency.
Only new messages arriveCheck existing positions for the actual group and source retention. Define the replay scope and target deduplication rules first; do not directly reset production positions.

For other task, write, and runtime issues, see Troubleshooting by symptom.

6. Stop and recover​

Stop the original task in the list and record the actual consumer group, topics, target tables, last verification time, and partition positions. Preserve the original task configuration during maintenance, and ensure messages remain within Kafka retention. Do not substitute copying tasks, changing groups, or deleting caches for recovery.

Send a message with a new timestamp during downtime and confirm the target does not yet contain it. Then start the original task and query the target to confirm the downtime message was read, followed by checks for the full downtime window. An interruption between position commit and target acknowledgment may cause rereads. taosX cannot fill gaps once source messages have expired. Verify planned stops/starts, checkpoints, and backfill separately using Restart, checkpoints, and store-and-forward.

The following image shows query results after collection resumes and reads the third message: temperatures for d001 are 23.5, 24.5, and 25.5, with millisecond timestamps increasing by 1000. These three rows include the third message sent during downtime. If only the first two messages in section 4 were sent, expect two rows.

Actual query results after the original Kafka task resumes and reads the third temperature message

7. Limitations​

Confirm the following constraints before configuring and maintaining tasks. Accepted configuration, successful previews, or a running task cannot replace target-data verification.

Operation or settingBoundary and required action
Select a target supertableSelect the target database, enter a message sample, and run the parsing preview first. Supertable selection and subsequent processing controls may be disabled until parsing succeeds. Check parsing results before repeatedly creating target tables.
Upload JSON message samplesTo replace samples, click Clear first, then upload and preview as described in Kafka file samples. File organization and append behavior are explained there.
Retrieve and preview samplesThe UI's initial sample row limit is 5, with a maximum of 100. This is not a limit on production task consumption. Server retrieval, manual input, and file upload are for configuration and preview only. Preview does not write to the target database or replace production consumption verification.
Add rules or samplesLimits apply to serialized configuration bytes, not a fixed number of rules. Task parsing configuration is limited to 960 KiB (983040 bytes), including samples and preview settings saved by the UI. Derived job configuration has a separate total limit of 1 MiB (1048576 bytes). At the limit, reduce unnecessary samples and duplicate configuration. If splitting tasks, recheck consumer groups and read scopes to avoid unintended message sharing or duplicate writes.
Increase read concurrencyPositive read_concurrency does not exceed the total partition count of subscribed topics. With 0 or omission, the collector determines it from the total partition count. Increasing it cannot give one partition multiple parallel reading instances. Write concurrency is separate.
Use Offset and consumer groupsThe current UI offers only Earliest and Latest, with no ByTime control. Changing the fallback position does not reset existing group offsets. Consumers in the same group participate in partition assignment. See Topics, clients, and consumer positions.
Determine whether consumption has caught upPositions are automatically committed every 5000 ms by default; actual configuration can override the interval. If the target briefly contains records while committed positions have not advanced, wait for commit and recheck. Even at zero Lag, verify target tables, timestamps, and values. Do not assume archived or discarded messages are automatically replayed.
Configure authenticationThe current UI lists PLAIN, SCRAM-SHA-256, and GSSAPI. Acceptance of a mechanism string in a direct DSN does not mean the UI offers it. GSSAPI initialization executes commands through bash -c in the actual reading environment. Confirm that the running identity can use the required bash, Kerberos client, and files. For TLS endpoint-verification and private-key-passphrase implementation limits, see Connector parameters. An unauthenticated exercise does not replace authentication verification.

This page is the Kafka ingestion operations guide. Types, direct-DSN defaults, units, and conditions for connection and consumption parameters are collected in Connector parameters. Do not use UI names directly as DSN parameter names. Configure shared parsing, mapping, and write settings in their respective chapters.

The examples here cover only a single node, no authentication, one topic, and one JSON structure. Before production use, verify ingestion against the actual topology, authentication, partitions, and message structures, along with required high-availability and recovery scenarios.