User Tools

Site Tools


replicator_agent_plugin_io_datetime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

replicator_agent_plugin_io_datetime [2017/08/07 10:45] (current)
jackson.davenport created
Line 1: Line 1:
 +====== IO Datetime Plugin ======
 +The following plugin can be activated for the Replicator Agent to populate data for the timestamps of the IO it performs. So using this you can have the date and time of when it 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 one plugin to activate them. 
 +
 +<code xml>
 +<!-- 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>​
 +</​code>​
 +
 +===== Example Agent =====
 +Here is an example of how to place them in the Agent. It should be placed within the <​task>​ tags.
 +<code xml>
 +<?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>​
 +
 +</​code>​
 +
 +===== Details =====
 +This will populate the two columns "​psp_per_insert_dt"​ and "​psp_per_update_dt"​ with their corresponding data through the plugin inputted. Note you can name these columns anything. Just make sure the column names match up between the plugin and dynamic column, and, that you won't get any column name conflicts with your Subscribing data.
replicator_agent_plugin_io_datetime.txt ยท Last modified: 2017/08/07 10:45 by jackson.davenport