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 JSON in Avro Format Example

Custom JSON in Avro Format Example

You can use the Custom Pattern Formatter to customize your existing JSON or generate the same JSON output in Avro format.
For example, the following custom pattern file generates JSON output in Avro format:
# The following pattern is an example of using the Custom Pattern Formatter # to generate the same JSON output as the Avro Formatter. # # #----------------------------------------------------------------------------------------------- # Special Attributes Section #----------------------------------------------------------------------------------------------- <SPECIAL_ATTRIBUTES> <DELIMITER>,</DELIMITER> <REPEAT_DELIMITER>,</REPEAT_DELIMITER> # Handling null values like Avro does - this is the text displayed for a null column value. <NULL_REPLACEMENT_VALUE>null</NULL_REPLACEMENT_VALUE> </SPECIAL_ATTRIBUTES> #----------------------------------------------------------------------------------------------- # Column Attributes Section #----------------------------------------------------------------------------------------------- <COLUMN_ATTRIBUTES> # Tagging columns <TAG> # Excluding columns <EXCLUDE> # Data Type Swapping <DT_SWAP> # Date/Time masking <DT_MASK> # Data type value quoting <DT_QUOTES> <DT_QUOTES> <data_type>string</data_type> <quote_character>"</quote_character> </DT_QUOTES> <DT_QUOTES> <data_type>date</data_type> <quote_character>"</quote_character> </DT_QUOTES> <DT_QUOTES> <data_type>time</data_type> <quote_character>"</quote_character> </DT_QUOTES> <DT_QUOTES> <data_type>timestamp</data_type> <quote_character>"</quote_character> </DT_QUOTES> <DT_QUOTES> <data_type>bytes</data_type> <quote_character>"</quote_character> </DT_QUOTES> # Enabled or disable allowing quotes around null values. Just explicitly disabled here for example that it can be changed <DT_QUOTES> <quote_null_values>false</quote_null_values> </DT_QUOTES> </COLUMN_ATTRIBUTES> #----------------------------------------------------------------------------------------------- # Insert Event Section #----------------------------------------------------------------------------------------------- <INSERT_EVENT> { <REPEAT> "<column_name>":<NULLABLE_VALUE><BOOLEAN_VALUE>{"<column_type>":<column_value>}</BOOLEAN_VALUE> </NULLABLE_VALUE> </REPEAT> } </INSERT_EVENT> #----------------------------------------------------------------------------------------------- # Update Event Section #----------------------------------------------------------------------------------------------- <UPDATE_EVENT> { <REPEAT> "<column_name>":<NULLABLE_VALUE><BOOLEAN_VALUE>{"<column_type>":<column_value>}</BOOLEAN_VALUE> </NULLABLE_VALUE> </REPEAT> } </UPDATE_EVENT> #----------------------------------------------------------------------------------------------- # Delete Event Section #----------------------------------------------------------------------------------------------- <DELETE_EVENT> { <REPEAT> "<column_name>":<NULLABLE_VALUE><BOOLEAN_VALUE>{"<column_type>":<column_value>}</BOOLEAN_VALUE> </NULLABLE_VALUE> </REPEAT> } </DELETE_EVENT> #----------------------------------------------------------------------------------------------- # Commit Event Section (not used) #----------------------------------------------------------------------------------------------- #<COMMIT_EVENT> #</COMMIT_EVENT>

0 COMMENTS

We’d like to hear from you!