All Products
Search
Document Center

Lindorm:Create Data Subscription

Last Updated:Jul 17, 2026

Create data subscription channels in pull and push modes.

Prerequisites

Create a pull mode data subscription channel

Procedure

  1. Go to the LTS page. In the left-side navigation pane, choose Change Tracking > Pull mode.

    This takes you to the Subscription channel list page of Lindorm CDC. The Create data subscription channel button is in the upper-right corner. The list displays the subscription channel ID, Lindorm table name, topic name, and actions (Details and Delete) for existing channels.

  2. Click Create data subscription channel and configure the following parameters.

    Parameter

    Description

    Source cluster

    Enter the Lindorm instance ID.

    Lindorm table name

    Select the Lindorm table that you want to subscribe to. Each channel can subscribe to only one table.

    Topic name

    The name of the data consumption topic.

    Data expiration time (days)

    The number of days to retain data. The default value is 7.

    Number of topic partitions

    The number of partitions for the topic. Multiple partitions enable concurrent data consumption. The default value is 4.

  3. Click Submit.

  4. (Optional) To view the details of a channel, find it in the list and click Details in the Operation column. You can view the channel details, consumption details, and storage details.

  5. (Optional) Use the following code example with a Kafka client to consume the subscribed data.

    import org.apache.hadoop.hbase.util.Bytes;
    import org.apache.kafka.clients.admin.AdminClientConfig;
    import org.apache.kafka.clients.consumer.ConsumerConfig;
    import org.apache.kafka.clients.consumer.ConsumerRecord;
    import org.apache.kafka.clients.consumer.ConsumerRecords;
    import org.apache.kafka.clients.consumer.KafkaConsumer;
    import org.apache.kafka.common.serialization.ByteArrayDeserializer;
    import java.time.Duration;
    import java.util.Arrays;
    import java.util.Properties;
    public class TestConsume {
      public static void main(String[] args) throws Exception {
        // The topic name that you specified when creating the data subscription channel.
        String topic = "test-topic";
        // Properties for connecting to the endpoint.
        Properties props = new Properties();
        // Specify the endpoint address.
        props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "ld-xxx:9092");
        // The key deserializer. Do not change this value.
        props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());
        // The value deserializer. Do not change this value.
        props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName());
        // The name of the consumer group. The group is automatically created during consumption.
        props.put(ConsumerConfig.GROUP_ID_CONFIG, "group-id-0");
        // Create a consumer.
        KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<>(props);
        // Subscribe to the topic.
        consumer.subscribe(Arrays.asList(topic));
        // Pull data by using the consumer.
        ConsumerRecords<byte[], byte[]> records = consumer.poll(Duration.ofMillis(10000));
        for (ConsumerRecord<byte[], byte[]> record : records) {
          // View the data content.
          System.out.println("key: " + Bytes.toString(record.key()));
          System.out.println("value: " + Bytes.toString(record.value()));
        }
        // Commit the current consumer offset.
        consumer.commitSync();
        // Close the consumer.
        consumer.close();
      }
    }
    Note

    For more information about the data consumption format, see Data consumption format.

Create a Push channel for data subscription

Process

The following figure shows how the messages of incremental data in a Lindorm table are pushed to Message Queue for Apache Kafka.

image

Create a Lindorm stream

  1. Go to the Lindorm Tunnel Service (LTS) console. In the left-side navigation pane, choose Change Tracking > Push.

  2. Click create and configure the parameters.

    Parameter

    Description

    Lindorm Cluster

    Select the created LindormTable data source.

    Table Name

    The name of the table for which you want to capture data changes. The format is namespace.tablename.

    For example, ns1.table1 specifies that you want to capture data from the table1 table in the ns1 namespace.

    Blacklist table (Optional)

    Specify tables whose incremental data should not be pushed. Changes in these tables are ignored.

    MessageStorage Type

    Select KAFKA.

    Storage Datasource

    Select the created Kafka data source.

    MessageStorage Config

    • kafka_topic: Specify the name of the Kafka topic.

    • kafka_ttl: Leave this empty.

    • kafka_partition_num: Leave this empty.

    Important

    In push mode, you must create the topic in Kafka in advance.

    MessageVersion

    The message format. The default is DebeziumV2.

    Message Config

    • old_image: Specifies whether the message includes the row values before a change. You must set this parameter to true. Setting it to false is not supported.

    • new_image: Specifies whether the message includes the row values after a change. You must set this parameter to true. Setting it to false is not supported.

    • with_schema: Specifies whether the message includes the table schema. Set this parameter to false to prevent oversized messages.

    • ignore_family_prefix: Specifies whether to remove the column family prefix from the exported column names. For example, if the full column name is f:name, setting this parameter to true results in the exported column name name.

  3. Click Submit.