IBM Support

How to customize delimiter of topic names defined by CDC for Kafka's KCOP

How To


Summary

So far, the default user topic name's delimiter is ".", if we want to change it to another character in KCOP, there are two ways to archive that (one example: if we want to change from "." to "_"):
1. Use the one in current kcop (check KcopTopicMappingIntegrated.java for example), you need to know the topic name before changing it though (example: MAP_TABLE_kfk.k55.sourcedb.tabschema.a2=kfk_k55_sourcedb_tabschema_a2).
2. As an alternative, we can programmatically alter the KCOP to replace characters in the default topic name. We will use the KcopJsonFormatIntegrated.java as an example, do the following:
In createProducerRecords() method, search for the default topic name,
1) search for "jsonTopicName",
2) locate this line" String jsonTopicName = kafkaKcopOperationIn.getKafkaTopicName() + "-json";",
3) replace it with "
String jsonTopicNameOld = kafkaKcopOperationIn.getKafkaTopicName() + "_json";
String jsonTopicName = jsonTopicNameOld.replaceAll("\\.", "_");"

If user wants to use other delimiter, just replace "_" with your needed character.

Document Location

Worldwide

[{"Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSTRGZ","label":"InfoSphere Data Replication"},"ARM Category":[{"code":"a8m0z000000cwsKAAQ","label":"Kafka"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.4.0"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
23 September 2020

UID

ibm16335151