Skip to content

Routing messages from a single data queue to multiple topics

To route messages from a single data queue to multiple topics, first point several tables to the same data queue on the IBM i side. Then configure the data queue source connector.

Point multiple tables to a single data queue

This procedure assumes that the tables you want to route are already added in InfoCDC.

  1. Open the InfoCDC screen and select option 1.

    InfoCDC main screen with option 1 selected

  2. Point the tables to a single data queue. In this example, three tables are routed to the data queue CDCDQ301. The tables ORDERDTL and ORDERHDR currently point to CDCDQ323 and CDCDQ281. Point both of them to CDCDQ301.

    InfoCDC table list with the three tables to route to a single data queue highlighted

    1. Stop the workflow for all three tables.
    2. Select option 2 (Edit Columns) for the table ORDERDTL, change the DQ name to CDCDQ301, and press F10 to update.

      Edit Columns screen with the DQ name changed to CDCDQ301

    3. Press F10 again to apply the change.

      Confirmation screen for the DQ name change

    4. Press F5 to refresh and make sure that the replication data queue is now CDCDQ301 instead of CDCDQ323.

    5. Repeat steps 1 to 4 for the table ORDERHDR.
    6. Start the workflows for all three tables.
  3. Check that all three tables point to the single data queue CDCDQ301.

    InfoCDC table list showing all three tables with the replication data queue CDCDQ301

Configure the data queue source connector

Configure the data queue source connector to route messages from the single data queue, including messages from different tables, to their respective topics:

  • Do not set the format file name and the format file library. The connector picks them dynamically.
  • Add the property "source.multiTopic": "true".
  • The connector generates the topic names dynamically, using the following naming convention:

    <value of source.kafka.topic>_<system table library name>_<system table name>
    

    For example: T_INFOCDCDEM_ORDERDTL.

Sample data queue source connector configuration:

{
  /* other properties are removed for brevity */
  "as400.read.dataqueue.name": "CDCDQ301",
  "as400.read.dataqueue.library": "INFOCDCDEM",
  "source.multiTopic": "true",
  "source.kafka.topic": "T"
}

With this configuration, the changes of the table ORDERDTL in the library INFOCDCDEM are published to the topic T_INFOCDCDEM_ORDERDTL.