Kafka message formats¶
The Format chooses the Apply extension (the className):
| Format | className |
What it writes |
|---|---|---|
| JSON | com.starquest.sqdr.apply.kafka.KafkaSparkProcessor |
One JSON message per row change, plus schema and end-of-batch messages. Use this one. |
| JSON (classic) | com.starquest.sqdr.apply.kafka.KafkaJsonProcessor |
One JSON message per row change, without schema or end-of-batch messages. |
| XML | com.starquest.sqdr.apply.kafka.KafkaXmlProcessor |
Nothing: in Stelo Capture 7.0 this extension doesn't write messages. Don't use it. |
The other Kafka extensions (Confluent Avro, JSON Schema and Protobuf) are entered as the className in Raw; see
Apply extensions.
JSON¶
Each message is a JSON object, sent as a UTF-8 string with no key:
| Field | Contents |
|---|---|
group |
The incremental group's ID, in hexadecimal. |
txid |
The source transaction, in hexadecimal; null in baseline rows. |
seq |
The change's sequence number. |
operation |
What the message is (see below). |
beforekey |
For I, U and D: the row's key column values, before the change for U and D (the RRN or ROWID column when the table has no key). For SCHEMA: the key column names, comma-separated. Otherwise null. |
dest |
The destination table: schema.table. |
row |
The column values after the change, by destination column name. For SCHEMA, the column types. |
operation |
Meaning |
|---|---|
SCHEMA |
Sent before a baseline and before each table's changes in a batch: row gives each column's type (BIGINT, INTEGER, SMALLINT, TINYINT, DECIMAL, FLOAT, REAL, DOUBLE, DATE, TIMESTAMP, BOOLEAN, BINARY or STRING). |
K |
Sent at the start of a baseline, after SCHEMA, with every column null. In changes, an update that changed the row's key: beforekey has the old key, and a U with the new values follows (see Operation codes). |
L |
A row copied by a baseline. |
I, U, D |
An insert, update or delete at the source. |
T |
The source table was truncated. |
E |
The end of a baseline, or of a table's changes in a batch. Every column is null. |
For a member that archives changes, an update or delete is sent as I, a truncate as t, and the baseline's K and
the E messages as k and e, so consumers can keep every version. Members with Ignore Deletes send no D.
Values are JSON numbers for numeric columns, strings for character, date and time columns (timestamps as
2026-11-06T10:15:30.123), and Base64 strings for binary columns. An update, for example:
{"group":"8F2A41D0C3B54E6A9D17A0B2C4E6F801","txid":"00000000001A2B3C4D5E","seq":12,"operation":"U",
"beforekey":{"ID":1001},"dest":"sales.CUSTOMER",
"row":{"ID":1001,"NAME":"Contoso","BALANCE":125.50,"UPDATED":"2026-11-06T10:15:30.123"}}
(shown on three lines; each message is one line). A baseline sends SCHEMA, K, one L per row and E.
JSON (classic)¶
The same fields, except: there are no SCHEMA, K-at-baseline and E messages; beforekey is set only for U and
D, and uses the source column names; in baseline rows the column values are top-level fields instead of being in
row. Each message is sent and acknowledged before the next, which is slower.
Duplicates after a restart¶
SQDR delivers each change at least once. When a group is paused, the Replicator Service or the Capture Agent is
stopped, or the connection is lost, the changes sent since the group's last committed position are sent again when it
resumes. A consumer that must not apply a change twice can detect the repeats with txid and seq, per destination
table (dest):
- a message whose
txidis lower than thetxidof the last message processed for the table is a repeat; - with the same
txid, a message whoseseqis lower than or equal to the last one processed is a repeat.
Baseline rows (L) have no txid: a baseline that runs again starts with K (see JSON), and the consumer
reloads the table.
The beforekey of U and D messages names the row's key columns (primary key, unique index, or RRN/ROWID) with
their values: use it to find the row at the destination.