User Tools

Site Tools


sql_sharer_agent

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
sql_sharer_agent [2016/07/19 11:24]
jackson Added link to troubleshooting page
sql_sharer_agent [2017/01/04 13:43] (current)
jackson cleanup
Line 1: Line 1:
-====== Share by LastUpdate Agent ====== 
-This section describes the configuration requirements and options for leveraging the Perspectium SQL Sharer Replicator Agent to replicate database rows that have been modified since the last run interval based on a datetime column value in the table. 
- 
-<wrap info>​v3.10.0</​wrap>​\\ 
- 
-<WRAP round info>The timestamp of the last run interval is saved in the <​AGENT_HOME>/​bin/​sharedState directory. ​ The file name is formatted <​task_name>​_<​table_name>​.txt </​WRAP>​ 
- 
-Below is a sample config.xml and agent.xml for sharing messages: 
- 
-config.xml 
-<code xml> 
-<?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​ 
-<​config>​ 
-    <​common>​ 
-    </​common>​ 
-</​config> ​   ​ 
-</​code>​ 
- 
-agent.xml 
-<code xml> 
-<?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​ 
-<​config>​ 
-    <​agent> ​ 
- <​share>​ 
-            <​task>​ 
-                <​task_name>​sql_last_update_sharer</​task_name>​ 
-                <​handler>​com.perspectium.replicator.sql.sharer.SQLShareByLastUpdateQuery</​handler>​ 
-                ​ 
-                <​polling_interval>​30</​polling_interval>​ 
-                <​message_connection user="​username"​ password="​password"​ queue="​psp.out.servicenow.instance_name">​amqp://​localhost</​message_connection>​ 
- <​encryption_key>​The cow jumped over the moon</​encryption_key>​ 
-                <​table_name>​ticket</​table_name>​ 
- <​topic>​replicator</​topic>​ 
- <​type>​agent</​type>​ 
- <​name>​.bulk</​name>​ 
- <​key>​will be overridden</​key>​ 
- 
- <​database_type>​mysql</​database_type>​ 
-                <​database_server>​localhost</​database_server>​ 
-                <​database_port>​3306</​database_port>​ 
-                <​database_user>​database_user</​database_user>​ 
-                <​database_password>​database_password</​database_password>​ 
-                <​database_params>​autoReconnect=true</​database_params>​ 
-                <​database>​psp_repl</​database>​ 
-                ​ 
-                <!-- the <​column_names>​ element is an optional \, delimited list of the columns you want to select for sharing --> 
-                <!-- if not specified it will default to all columns-->​ 
-                <​column_names>​number\,​short_description</​column_names>​ 
-                ​ 
-                <!-- the <​where>​ element is an optional filter criteria that can be applied in addition to the last interval filter ​ 
-                     - You are responsible for properly escaping column names that are SQL reserved words. 
-                <​where>​`assignment_group` = '​Network'</​where>​ 
-                --> 
-                ​ 
-                <!-- The <​datetime_field>​ element is an optional datetime column name to use as the last updated by query value. ​ If not specified, the default is sys_updated_on 
-                <​datetime_field>​timestamp_column</​datetime_field>​ 
-                --> 
- 
-                <!-- The <​last_modified_timezone>​ element is used to specify the timezone used to match the timestamp column. ​ It should be the same timezone used by your timestamp column. ​ 
-                <​last_modified_timezone>​GMT</​last_modified_timezone>​ 
-                --> 
- 
-             </​task>​ 
- </​share> ​     
-    </​agent>​ 
-</​config> ​   ​ 
-</​code>​ 
- 
-For troubleshooting with this feature see [[replicator_agent_troubleshooting#​sql_share_by_last_update|here]]. 
 ====== Scheduled Sharer Agent ====== ====== Scheduled Sharer Agent ======
- 
-<wrap info>​v3.3.0</​wrap>​\\ 
  
 This section describes the configuration requirements and options for leveraging the Perspectium SQL Sharer Replicator Agent to replicate database tables on an scheduled basis. This section describes the configuration requirements and options for leveraging the Perspectium SQL Sharer Replicator Agent to replicate database tables on an scheduled basis.
Line 91: Line 20:
 </​WRAP>​ </​WRAP>​
  
-==== Sample ​config.xml and agent.xml Configuration Files ====+==== Sample agent.xml Configuration Files ====
 To setup the SQL scheduled sharer agent, you will have specify in agent.xml the server it will send messages to and also specify a queue where the agent will send the messages to. Please contact [[support@perspectium.com]] with any questions on your Perspectium server and/or queue. To setup the SQL scheduled sharer agent, you will have specify in agent.xml the server it will send messages to and also specify a queue where the agent will send the messages to. Please contact [[support@perspectium.com]] with any questions on your Perspectium server and/or queue.
  
-<WRAP round important>​ 
-Since this is a scheduled share task and not an on-demand share task, you are not required to further configure the config.xml. 
-</​WRAP>​ 
  
-Below is a sample ​config.xml and agent.xml for sharing messages:+Below is a sample agent.xml for sharing messages:
  
-config.xml 
 <code xml> <code xml>
 <?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​ <?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​
 <​config>​ <​config>​
-    ​<common+  ​<agent 
-    </common>+  ​ 
 +    ​<​max_writes_per_connect>​10</​max_writes_per_connect>​ 
 +    <​polling_interval>​15</​polling_interval>​ 
 +    <​message_connection user="​ACME"​ password="​XXXX">​amqps://​acme.perspecium.net/</​message_connection>​ 
 + 
 +    <​share>​ 
 +      <​task>​ 
 +        <​task_name>​sql_sharer</​task_name>​ 
 +        <​handler>​com.perspectium.replicator.sql.sharer.SQLSharer</​handler> ​       
 +        <​message_connection user="​ACME"​ password="​XXXX"​ queue="​psp.out.servicenow.instance_name">​amqps://​acme.perspecium.net/</​message_connection>​ 
 + <​encryption_key>​The cow jumped over the moon</​encryption_key>​ 
 +         
 +        <​table_name>​ticket</​table_name>​ 
 + <​topic>​replicator</​topic>​ 
 + <​type>​agent</​type>​ 
 + <​name>​.bulk</​name>​ 
 + <​key>​will be overridden</​key>​ 
 + 
 + <​schedule>​0 0 * * *</​schedule>​ 
 + 
 + <​database_type>​mysql</​database_type>​ 
 +        <​database_server>​localhost</​database_server>​ 
 +        <​database_port>​3306</​database_port>​ 
 +        <​database_user>​database_user</​database_user>​ 
 +        <​database_password>​database_password</​database_password>​ 
 +        <​database_params>​autoReconnect=true</​database_params>​ 
 +        <​database>​psp_repl</​database>​ 
 +        </​task>​ 
 +    </​share>​ 
 +     
 +  ​</agent>
 </​config> ​   ​ </​config> ​   ​
 +
 </​code>​ </​code>​
  
-agent.xml+When the SQL scheduled sharer agent is started, the agent will use the configuration as specified in the <​task>​ directive in agent.xml and it will query the database configured and share out records in messages to the Perspectium server configured in <​message_connection>​ within the defined <​schedule>​ interval configured by the user. 
 + 
 + 
 +====== Share by LastUpdate Agent ====== 
 +<wrap info>​v3.10.0</​wrap>​\\ 
 + 
 +This section describes the configuration requirements and options for leveraging the Perspectium SQL Sharer Replicator Agent to replicate database rows that have been modified since the last run interval based on a datetime column value in the table. 
 + 
 +<WRAP round info>The timestamp of the last run interval is saved in the <​AGENT_HOME>/​bin/​sharedState directory. ​ The file name is formatted <​task_name>​_<​table_name>​.txt </​WRAP>​ 
 + 
 +Below is a sample ​agent.xml ​for sharing messages: 
 <code xml> <code xml>
 <?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​ <?xml version="​1.0"​ encoding="​ISO-8859-1"​ standalone="​no"?>​
 <​config>​ <​config>​
-    ​<​agent>​  +  ​<​agent>​  
- <​share>​ + 
-            <​task>​ +    <​polling_interval>​30</​polling_interval>​
-                <​task_name>​sql_sharer</​task_name>​ +
-                <​handler>​com.perspectium.replicator.sql.sharer.SQLSharer</​handler>​ +
-                 +
-                <​max_writes_per_connect>​7</​max_writes_per_connect>​ +
-                ​<​polling_interval>​15</​polling_interval+
-                <​message_connection user="​username"​ password="​password"​ queue="​psp.out.servicenow.instance_name">​amqp://​localhost</​message_connection>​ +
- <​encryption_key>​The cow jumped over the moon</​encryption_key>​ +
-                <​table_name>​ticket</​table_name>​ +
- <​topic>​replicator</​topic>​ +
- <​type>​agent</​type>​ +
- <​name>​.bulk</​name>​ +
- <​key>​will be overridden</​key>+
  
- <schedule>0 0 * * *</schedule>+    ​<share> 
 +      <​task>​ 
 +        <​task_name>​sql_last_update_sharer</​task_name>​ 
 +        <​handler>​com.perspectium.replicator.sql.sharer.SQLShareByLastUpdateQuery</​handler>​ 
 +             
 +        <​message_connection user="​ACME"​ password="​XXXX"​ queue="​psp.out.servicenow.instance_name">​amqps://​acme.perspecium.net/</​message_connection>​ 
 +        <​encryption_key>​The cow jumped over the moon</​encryption_key>​ 
 +         
 +        <​table_name>​ticket</​table_name>​ 
 +        <​topic>​replicator</​topic>​ 
 +        <​type>​agent</​type>​ 
 +        <​name>​.bulk</​name>​ 
 +        <​key>​will be overridden</key>
  
- <​database_type>​mysql</​database_type>​ +        ​<​database_type>​mysql</​database_type>​ 
-                <​database_server>​localhost</​database_server>​ +        <​database_server>​localhost</​database_server>​ 
-                <​database_port>​3306</​database_port>​ +        <​database_port>​3306</​database_port>​ 
-                <​database_user>​database_user</​database_user>​ +        <​database_user>​database_user</​database_user>​ 
-                <​database_password>​database_password</​database_password>​ +        <​database_password>​database_password</​database_password>​ 
-                <​database_params>​autoReconnect=true</​database_params>​ +        <​database_params>​autoReconnect=true</​database_params>​ 
-                <​database>​psp_repl</​database>​ +        <​database>​psp_repl</​database>​ 
-             ​</task+                               
- </share    ​ +        ​<!-- The <​datetime_fieldelement is the datetime column name to use as  
-    </agent> +             the last updated by query value. ​ If not specified, the default is sys_updated_on 
-</config   +        --
 +        <datetime_field>timestamp_column</datetime_field>
  
 +        <!-- The <​last_modified_timezone>​ element is used to specify the timezone used
 +             to match the timestamp column. ​ It should be the same timezone used by 
 +             your timestamp column.
 +        -->
 +        <​last_modified_timezone>​GMT</​last_modified_timezone>​
 +
 +        <!-- the <​where>​ element is an optional filter criteria that can be applied in
 +             in addition to the last interval filter
 +             You are responsible for properly escaping column names that are SQL reserved words.
 +        <​where>​`assignment_group` = '​Network'</​where>​
 +        -->
 +
 +      </​task>​
 +    </​share> ​    
 +  </​agent>​
 +</​config> ​   ​
 </​code>​ </​code>​
  
-When the SQL scheduled sharer agent is started, the agent will use the configuration as specified in the <​task>​ directive in agent.xml and it will query the database configured and share out records in messages to the Perspectium server configured in <​message_connection>​ within the defined <​schedule>​ interval configured by the user.+For troubleshooting with this feature see [[replicator_agent_troubleshooting#​sql_share_by_last_update|here]].
  
 ====== On-Demand Sharer Agent ====== ====== On-Demand Sharer Agent ======
sql_sharer_agent.txt · Last modified: 2017/01/04 13:43 by jackson