The following plugin can be activated for the DataSync Agent to populate data for the timestamps of the IO (input/output) it performs. This plugin provides you with the date and time of each case the Agent inserts and updates a record in the database.

This can be activated by adding in two sets of config tags into the agent.xml: one to dynamically create the columns, and one to activate them:

<!-- Create the columns -->
<dynamic_columns>
    <dynamic_column column_type="93" column_size="32" updates_only="true">psp_per_update_dt</dynamic_column>
    <dynamic_column column_type="93" column_size="32" inserts_only="true">psp_per_insert_dt</dynamic_column>
</dynamic_columns>
 
<!-- Update the columns -->
<plugins>
    <plugin insert_column="psp_per_insert_dt" update_column="psp_per_update_dt">com.perspectium.replicator.sql.plugin.SQLSubscriberIODateTimePlugin</plugin>
</plugins>

By default, the update column (psp_per_update_dtwill be updated for both inserts and updates of a record. If you want the update column to be updated only when records are updated, include the update_column_only tag:

...
<plugin insert_column="psp_per_insert_dt" update_column="psp_per_update_dt" update_column_only=“true”>com.perspectium.replicator.sql.plugin.SQLSubscriberIODateTimePlugin</plugin>
...


Example of agent.xml

The following example will populate the two columns psp_per_insert_dt and psp_per_update_dt with their corresponding data through the plug inputted. You can name these columns whatever you wish, as long as the names match between the plugin and the dynamic column, and that you won't experience any column name conflicts with your subscribing data. 

(info) NOTEThe tags should be placed within the <task> tags.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
  <agent>
    <subscribe>
      <task>
        <task_name>example_subscribe</task_name>
        <message_connection queue="psp.out.replicator.example" user="acme" password="XXXXX">amqps://example.perspectium.net</message_connection>
        <instance_connection user="acme" password="XXXXX">https://example.service-now.com</instance_connection>
        <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
        <decryption_key>The cow jumped over the moon</decryption_key>
 
        <database_type>mysql</database_type>
        <database_server>localhost</database_server>
        <database_port>3306</database_port>
        <database_user>acme</database_user>
        <database_password>XXXXX</database_password>
        <database>example</database>
 
        <dynamic_columns>
          <dynamic_column column_type="93" column_size="32" updates_only="true">psp_per_update_dt</dynamic_column>
          <dynamic_column column_type="93" column_size="32" inserts_only="true">psp_per_insert_dt</dynamic_column>
        </dynamic_columns>
 
        <plugins>
          <plugin insert_column="psp_per_insert_dt" update_column="psp_per_update_dt">com.perspectium.replicator.sql.plugin.SQLSubscriberIODateTimePlugin</plugin>
        </plugins>
 
      </task>
    </subscribe>
 
    <max_reads_per_connect>1000</max_reads_per_connect>
    <polling_interval>5</polling_interval>
  </agent>
</config>