All Products
Search
Document Center

Realtime Compute for Apache Flink:Flink CDC route module

Last Updated:Oct 21, 2025

The route module defines rules to map source tables to sink tables. This topic describes the syntax for defining routing rules.

Parameters

Parameter

Description

Required

Remarks

source-table

Specifies the source table.

Required

Supports regular expressions.

sink-table

Specifies the sink table.

Required

replace-symbol

Specifies the string in the sink table name to be replaced by the source table name.

Optional

For example, when replace-symbol is set to <>, you can configure sink-table as sinkdb.<>. If the source table is table1, data is replicated to the sink table with the identical name sinkdb.table1.

description

The description of the routing rule.

Optional

Important

Perform a stateless startup after modifying the route module to apply the new rules.

Examples

Sync data from a source table to a sink table

Route data from the source table mysql_db.web_order to the sink table sink_db.ods_web_order:

route:
  - source-table: mysql_db.web_order
    sink-table: sink_db.ods_web_order
    description: sync data from a source table to a sink table
image

Sync data from a source table to multiple sink tables

To copy data from a source table to multiple sink tables, define multiple routing rules. The following code replicates data from mydb.orders to sink_db.orders and backup_sink_db.orders at the same time.

route:
  - source-table: mydb.orders
    sink-table: sink_db.orders
  - source-table: mydb.orders
    sink-table: backup_sink_db.orders
image

Sync data from multiple source tables to multiple sink tables

Define multiple rules using a hyphen (-), which is the YAML list indicator. All these rules are applied concurrently.

route:
  - source-table: mydb.orders
    sink-table: ods_db.ods_orders
    description: sync orders table to ods_orders
  - source-table: mydb.shipments
    sink-table: ods_db.ods_shipments
    description: sync shipments table to ods_shipments
  - source-table: mydb.products
    sink-table: ods_db.ods_products
    description: sync products table to ods_products
image

Sync data from multiple source tables to a sink table

Merge all tables from the source_db database into the target sink_db.merged table.

route:
  - source-table: source_db.\.*
    sink-table: sink_db.merged
    description: sync data from multiple source tables to a sink table
image

Database synchronization

Sync all tables from the source_db database to corresponding tables in the sink_db database, keeping the table names unchanged.

route:
  - source-table: source_db.\.*
    sink-table: sink_db.<>
    replace-symbol: <>
    description: route all tables in source_db to sink_db

The <> symbol is a placeholder for the source table name, enabling one-to-one mapping from source tables to sink tables.

image