Database Ingestion and Replication > Database Ingestion and Replication targets - preparation and usage > Kafka targets and Kafka-enabled Azure Event Hubs targets
  

Kafka targets and Kafka-enabled Azure Event Hubs targets

The following list identifies considerations for using Kafka targets:

Generating custom message keys for Kafka targets

For all Kafka target types that use the Avro format, you can configure rules to generate a custom message key that consists of one or more columns for each source table. Database ingestion and replication incremental load jobs that have a Kafka target can then include the generated message key in the headers of the messages that it sends to the target messaging system. The target messaging system can use the message key to write messages with a specific key value to the same partition in a multi-partitioned topic.
To implement this feature, you must manually create a configuration file that contains rules that identify the key columns for each source table. Then specify the file in a custom configuration property in the task wizard.

Configuration file creation

Create the rule-configuration file in a text editor and save it to a location on the Secure Agent system. The file contains a rule for each source table. Each rule defines the custom key column or columns to use for writing data to topic partitions.
Note:
If you change or add a rule or change one of the other parameters after the
database ingestion and replication
task has been deployed, you must redeploy the task for the rule change to take effect.
Rule syntax:
Use the following syntax to define rules in the configuration file:
rule=(schema.tablename,column1,column2,column3,… )
additional rules...
[tableNotFound=ABORT]
[trace={true|false}]
[delimiter=character]
To include comments in the file, begin each comment line with the number (#) sign. For example:
#This text is for informational purposes only.
Parameters:
Example rule:
rule=(testdb.ABC.DEPT,DEPTNO,DNAME)
tableNotFound=ABORT
trace=true
delimiter=;
Example generated key output based on this rule:
1234;HR;

Database ingestion and replication task configuration

When you create a database ingestion and replication incremental load task that has a Kafka target, you must set the following options to enable the generation of custom message keys: