Table of Contents

Search

  1. Preface
  2. PowerExchange CDC Publisher Overview
  3. Installing and Upgrading PowerExchange CDC Publisher
  4. PowerExchange CDC Publisher Key Concepts
  5. PowerExchange Change Capture Environment
  6. Target Messaging Systems
  7. Configuring PowerExchange CDC Publisher
  8. Streaming Change Data
  9. Monitoring PowerExchange CDC Publisher
  10. Administering PowerExchange CDC Publisher
  11. Appendix A: Command Reference for the Command-Line Utilities
  12. Appendix B: Avro Schema Formats
  13. Appendix C: Custom Pattern Formats
  14. Appendix D: Message Reference

User Guide

User Guide

Configuring the Custom Pattern Formatter

Configuring the Custom Pattern Formatter

To use custom patterns, you must create a Custom Pattern Formatter configuration file. This configuration file contains a list of source tables and the locations of the custom pattern files for each table. The custom pattern files contain the custom pattern definitions for each source table.

Custom Pattern Formatter Configuration File

In the Custom Pattern Formatter configuration file, define the source table names and the full path and name of the file that contains the custom pattern definitions for each source table.
The configuration file uses the following tags:
Tag
Description
<table>
Defines the table name for table-specific custom patterns or specifies the keyword DEFAULT. Specify the DEFAULT keyword to indicate the custom pattern file or the formatter CDC Publisher should use for tables that are not specified.
<formatter>
If you specify DEFAULT in a <table> tag, you can specify this <formatter> tag. It specifies the default formatter to use when CDC Publisher encounters a table that is not listed in the Custom Pattern Formatter configuration file. The only valid value is AVRO. When AVRO is specified and the table is not found in the list, the results will be written to Kafka in the Avro message format. This option allows some tables to use the Custom Pattern Formatter while other tables use the existing Avro format.
<path>
Specifies the path and name of the file that contains the custom pattern definition for the table specified in the <table> tag or the path of the file that contains the default custom pattern definition.
Place the configuration file in a location that is accessible to PowerExchange CDC Publisher. To specify the location of the file, specify the Formatter configuration property Formatter.customPatternFileList in the cdcPublisherAvro.cfg file. For example:
Formatter.customPatternFileList=pwxcdcpub_root_installation\instance\config\ customFormatterPatternsFile.list
Configuration File Example: Table-Specific Patterns with a DEFAULT Pattern
In the following example, the Custom Pattern Formatter configuration file contains three <table> definitions:
  • my_table1.pattern contains the custom patterns for my.table1.
  • my_table2.pattern contains the custom patterns for my.table2.
  • DEFAULT indicates that any table that does not have a table-specific custom pattern file should use the default custom pattern file called generic.pattern.
<table>my.table1</table><path>\pwxcdcpub_root_installation\instance\config\my_table1.pattern</path> <table>my.table2</table><path>\pwxcdcpub_root_installation\instance\config\my_table2.pattern</path> <table>DEFAULT</table><path>\pwxcdcpub_root_installation\instance\config\generic.pattern</path>
Configuration File Example: Table-Specific Patterns with a DEFAULT Pattern That Specifies Avro Format
In the following example, the Custom Pattern Formatter configuration file contains a DEFAULT table specification that specifies the Avro format type:
<table>my.table1</table><path>\pwxcdcpub_root_installation\instance\config\my_table1.pattern</path> <table>my.table2</table><path>\pwxcdcpub_root_installation\instance\config\my_table2.pattern</path> <table>DEFAULT</table><formatter>AVRO</formatter>
Based on the last statement, the formatted results for any table that is not specified in a <table> tag will be generated in the Avro format.

Table-Specific Custom Pattern Files

Provide a custom pattern file to describe the output by source tables. A custom pattern file contains user-defined patterns for specific tables. A custom pattern file can contain patterns that are used by more than one table or it can specify patterns for a specific table. Patterns are characterized by change data event types. Within a pattern, event type sections contain specifications that describe what PowerExchange CDC Publisher should do for the event type. You can define a custom pattern file with one or more sections. Each section in the file is independent. You do not need to define every event type. For example, if you want to write inserts for a table to Kafka, you do not need to specify the schema event, transaction event, update event, delete event, and commit event sections in the pattern within the file.
For example, assume that the following configuration property is set in the cdcPublisherAvro.cfg file:
Formatter.customPatternFileList=pwxcdcpub_root_installation\instance\config\mytables.list
The mytables.list file contains the locations of the custom pattern files for each table and has the following contents:
<table>tableA</table><path>\pwxcdcpub_root_installation\instance\config\tableA.pattern</path> <table>DEFAULT</table><path>\pwxcdcpub_root_installation\instance\config\generic.pattern</path>
The tableA.pattern file contains the custom patterns for table A, and the generic.pattern file contains the default custom patterns for any table that does not have a specific custom pattern file.
For information about the format and syntax of custom pattern files, see Appendix C: Custom Pattern Formats.

0 COMMENTS

We’d like to hear from you!