User Tools

Site Tools


replicator_agent_multiple_tasks

Multiple Agent Tasks

A Replicator Agent can be configured to have one or more tasks. These tasks represent the configuration and handler for their actual processing.

Each task will have access to its own section of the overall configuration in addition to those directives outlined within the <agent> section of the configuration.

For example here is an agent that:

  • Subscribes to the queue psp.out.replicator.acme and places the records into the database psp_repl
  • Subscribes to the queue psp.out.replicator.acmetest and places the data into the database psp_repl_test
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
  <agent>
    <subscribe>
      <!-- Subscribing Task -->
      <task>
        <task_name>acme_subscribe</task_name>
 
        <message_connection queue="psp.out.replicator.acme" password="XXXX" user="acme">https://acme.perspectium.net</message_connection>
        <instance_connection password="XXXX" user="acme">https://acme.service-now.com</instance_connection>
        <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
        <decryption_key>The cow jumped over the moon</decryption_key>
        <schedule>* * * * *</schedule> 
 
        <database_type>mysql</database_type>
       	<database_server>localhost</database_server>
     	<database_port>3306</database_port>
    	<database_user>root</database_user>
        <database_password></database_password>
    	<database_parms></database_parms>
        <database>psp_repl</database>
 
      </task>
 
      <!-- Subscribing Task -->
      <task>
        <task_name>acmetest_subscribe</task_name>
 
        <message_connection queue="psp.out.replicator.acmetest" password="XXXX" user="acme">https://acme.perspectium.net</message_connection>
        <instance_connection password="XXXX" user="acme">https://acmetest.service-now.com</instance_connection>
        <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
        <decryption_key>The cow jumped over the moon</decryption_key>
        <schedule>* * * * *</schedule> 
 
        <database_type>mysql</database_type>
       	<database_server>localhost</database_server>
     	<database_port>3306</database_port>
    	<database_user>root</database_user>
        <database_password></database_password>
    	<database_parms></database_parms>
        <database>psp_repl_test</database>
 
      </task>
    </subscribe>  	
 
    <max_reads_per_connect>2000</max_reads_per_connect>
    <polling_interval>5</polling_interval>
 
  </agent>
</config>

This can be used to have 1 Agent Subscribing from multiple sources/queues. This Agent can then write to the same database or to an entirely separate database.

replicator_agent_multiple_tasks.txt · Last modified: 2018/04/25 22:28 by jackson.davenport