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

Custom Pattern Syntax Validation

Custom Pattern Syntax Validation

You can use the PwxCDCAdmin utility to validate custom pattern syntax without sending data to the target.
To validate custom pattern syntax, specify the CHECKCUSTOMPATTERNS and INSTANCE parameters in the utility command. The utility uses the INSTANCE value to get the location of the custom pattern file. For more information, see Custom Pattern Formatter Configuration Properties.
The validation process checks the custom pattern syntax. It does not validate the structure or format of the output. For example, if you define custom patterns to create JSON output, the validation process does not validate the output to ensure it meets JSON syntax requirements. The validation process only validates the custom pattern tags and parameters that it recognizes.
If you want to simulate the message output from CDC Publisher, create a custom pattern data file. This file is optional. The custom pattern data file contains table definitions and the data for each table definition. It should also include a default table definition. The validation process uses the default table definition if it cannot find a custom pattern file for a specific table in the custom pattern data file. The validation process checks input values against the patterns and generates output based on the patterns. Specify the location of the custom pattern data file using the Formatter.customPatternDataFile property in the cdcPublisherAvro.cfg file. For more information, see Custom Pattern Formatter Configuration Properties.
The processor generates Informatica and PowerExchange-generated columns to simulate and check the custom patterns column attributes section if these columns are included in the custom pattern file for a table.

Custom Pattern Syntax Validation Example

In this example, the following Custom Pattern Formatter configuration properties are set in the cdcPublisherAvro.cfg file:
Formatter.customPatternFileListe=C:\\CDCPUB_Install\\Instance141\\config\\patterns.list Formatter.customPatternDataFile=C:\\CDCPUB_Install\\Instance141\\config\\patternTestData.dat
The patternTestData.dat custom pattern data file contains the following definitions for two specific tables and the default table:
[ # It has 3 data columns, but 1 of them is commented. # This is the default definition used if a table appears that does not have a specific definition # in this file. table_name = DEFAULT, column_name = "Column_1", column_type = "string", column_value = "This is column 1 data", # column_name = "Column_2", column_type = "string", column_value = "This is column 2 data", column_name = "Column_3", column_type = "integer", column_value = 22 ] # definition for tableA [ table_name = tableA, column_name = "AColumn_1", column_type = "string", column_value = "This is column 1 data for tableA", column_name = "AColumn_2", column_type = "string", column_value = "This is column 2 data for tableA" ] # definition for tableB [ table_name = tableB, column_name = "B_1", column_type = "string", column_value = "This is B 1 data for tableB", column_name = "B_2", column_type = "integer", column_value = 999 ]
The patterns.list Custom Pattern Formatter configuration file contains the following specifications:
<table>tableA</table><path>C:\CDCPUB_Install\Instance141\config\tableA.pattern</path> <table>DEFAULT</table><path>C:\CDCPUB_Install\Instance141\config\generic.pattern</path>
The tableA.pattern custom pattern file contains the following specifications:
<SPECIAL_ATTRIBUTES> <DELIMITER>,</DELIMITER> <REPEAT_DELIMITER>,</REPEAT_DELIMITER> </SPECIAL_ATTRIBUTES> <COLUMN_ATTRIBUTES> <EXCLUDE><column_name> INFA* </column_name></EXCLUDE> <EXCLUDE><column_name> DTL* </column_name></EXCLUDE> <EXCLUDE><column_name> *_Present </column_name></EXCLUDE> <EXCLUDE><column_name> *_BeforeImage </column_name></EXCLUDE> <EXCLUDE><column_name> *_BeforeImage_Present </column_name></EXCLUDE> </COLUMN_ATTRIBUTES> # this is for insert events <INSERT_EVENT> {"evnt":"<event_type>",<REPEAT>"<column_name>":"<column_value>"</REPEAT>} </INSERT_EVENT> # this is for update events <UPDATE_EVENT> {"evnt":"<event_type>",<REPEAT>"<column_name>":"<column_value>"</REPEAT>} </UPDATE_EVENT> # this is for delete events <DELETE_EVENT> {"evnt":"<event_type>",<REPEAT>"<column_name>":"<column_value>"</REPEAT>} </DELETE_EVENT>
The generic.pattern custom pattern file for the DEFAULT table pattern contains the following specifications:
<SPECIAL_ATTRIBUTES> <DELIMITER>,</DELIMITER> <REPEAT_DELIMITER>,</REPEAT_DELIMITER> </SPECIAL_ATTRIBUTES> <COLUMN_ATTRIBUTES> <EXCLUDE><column_name> INFA* </column_name></EXCLUDE> <EXCLUDE><column_name> DTL* </column_name></EXCLUDE> <EXCLUDE><column_name> *_Present </column_name></EXCLUDE> <EXCLUDE><column_name> *_BeforeImage </column_name></EXCLUDE> <EXCLUDE><column_name> *_BeforeImage_Present </column_name></EXCLUDE> </COLUMN_ATTRIBUTES> # this is for insert events <INSERT_EVENT> {"evnt":"<event_type>", "<transaction_id>", "<sequence>" <REPEAT>"<column_name>":"<column_value>"</REPEAT>} </INSERT_EVENT> # this is for update events <UPDATE_EVENT> {"evnt":"<event_type>", "<transaction_id>" : "<sequence>", <REPEAT>"<column_name>":"<column_value>"</REPEAT>} </UPDATE_EVENT> # this is for delete events <DELETE_EVENT> {"evnt":"<event_type>", "<transaction_id>" : "<sequence>", <REPEAT>"<column_name>":"<column_value>"</REPEAT>} </DELETE_EVENT> <COMMIT_EVENT> { "COMMIT" : "sequence" : "<sequence>", "transaction" : "<transaction_id>" } </COMMIT_EVENT>

Example Output

The PwxCDCAdmin utility generated the following example output based on two table-specific custom patterns and the DEFAULT custom pattern:
-------------------------------------------------------- Checking the custom patterns... Table tableA file C:\CDCPUB_Install\Instance141\config\tableA.cfg is processed Table DEFAULT file C:\CDCPUB_Install\Instance141\config\generic.cfg is processed ------------------------------------------------------------ Custom Pattern Tables List: tableA DEFAULT ------------------------------------------------------------ Custom Pattern Data file in use is C:/CDCPUB_Install/Instance141/config/patternTestData.dat Start Custom Data Patterns Processing... ------------------------------------------------------------ Custom Pattern Data Tables List: Table: tableB Column Name: DTL__CAPXACTION Column Type: string Column Value: dtlaction Column Name: DTL__CAPXRESTART1 Column Type: string Column Value: restart1ABCDEF Column Name: DTL__CAPXRESTART2 Column Type: string Column Value: restart2GHIJK Column Name: DTL__CAPXUSER Column Type: string Column Value: capxUser Column Name: DTL__CAPXUOW Column Type: string Column Value: UOW_1 Column Name: DTL__CAPXTIMESTAMP Column Type: timestamp Column Value: 202009251013370005050000 Column Name: DTL__CAPXROWID Column Type: integer Column Value: 3 Column Name: B_1 Column Type: string Column Value: This is B 1 data for tableB Column Name: B_2 Column Type: integer Column Value: 999 Table: tableA Column Name: DTL__CAPXACTION Column Type: string Column Value: dtlaction Column Name: DTL__CAPXRESTART1 Column Type: string Column Value: restart1ABCDEF Column Name: DTL__CAPXRESTART2 Column Type: string Column Value: restart2GHIJK Column Name: DTL__CAPXUSER Column Type: string Column Value: capxUser Column Name: DTL__CAPXUOW Column Type: string Column Value: UOW_1 Column Name: DTL__CAPXTIMESTAMP Column Type: timestamp Column Value: 202009251013370005050000 Column Name: DTL__CAPXROWID Column Type: integer Column Value: 2 Column Name: AColumn_1 Column Type: string Column Value: This is column 1 data for tableA Column Name: AColumn_2 Column Type: string Column Value: This is column 2 data for tableA Table: DEFAULT Column Name: DTL__CAPXACTION Column Type: string Column Value: dtlaction Column Name: DTL__CAPXRESTART1 Column Type: string Column Value: restart1ABCDEF Column Name: DTL__CAPXRESTART2 Column Type: string Column Value: restart2GHIJK Column Name: DTL__CAPXUSER Column Type: string Column Value: capxUser Column Name: DTL__CAPXUOW Column Type: string Column Value: UOW_1 Column Name: DTL__CAPXTIMESTAMP Column Type: timestamp Column Value: 202009251013370005040000 Column Name: DTL__CAPXROWID Column Type: integer Column Value: 1 Column Name: Column_1 Column Type: string Column Value: This is column 1 data Column Name: Column_3 Column Type: integer Column Value: 22 ------------------------------------------------------------ ------------------------------------------------------------ Table tableB will be processed using the DEFAULT custom pattern. ------------------------------------------------------------ Table tableB sample INSERT_EVENT: {"evnt":"INSERT_EVENT" , "table_name" : "tableB", "tranid" : "102", "sequence" : 1,2,SomeObject,3,4,5" "B_1":"This is B 1 data for tableB","B_2":"999"} Table tableB sample UPDATE_EVENT: {"evnt":"UPDATE_EVENT", "table_name" : "tableB", "tranid" : "102", "sequence" : 1,2,SomeObject,3,4,5", "B_1":"This is B 1 data for tableB","B_2":"999"} Table tableB sample DELETE_EVENT: {"evnt":"DELETE_EVENT", "table_name" : "tableB", "tranid" : "102", "sequence" : "1,2,SomeObject,3,4,5","B_1":"This is B 1 data for tableB","B_2":"999"} Table tableB sample COMMIT_EVENT: { "COMMIT" : "sequence" : "1,2,SomeObject,3,4,5", "tranid" : : "102" } ------------------------------------------------------------ Table tableA will be processed using a defined custom pattern. ------------------------------------------------------------ Table tableA sample INSERT_EVENT: {"evnt":"INSERT_EVENT" , "AColumn_1":"This is column 1 data for tableA","AColumn_2":"This is column 2 data for tableA"} Table tableA sample UPDATE_EVENT: {"evnt":"UPDATE_EVENT", "AColumn_1":"This is column 1 data for tableA","AColumn_2":"This is column 2 data for tableA"} Table tableA sample DELETE_EVENT: {"evnt":"DELETE_EVENT", "AColumn_1":"This is column 1 data for tableA","AColumn_2":"This is column 2 data for tableA"} ------------------------------------------------------------ ------------------------------------------------------------ Custom pattern validation succeeded

0 COMMENTS

We’d like to hear from you!