User Tools

Site Tools


replicator_agent_error_directory

Error Directory

The user can specify a directory for where messages that error out are placed. By doing so you can have a log of the actual data that of the message that we received in order for you to review and recover the record.

Set Up

This is done by placing the tag <error_directory>../errors</error_directory> within the agent.xml. This will create a directory named errors at the base Agent directory. Each error will get written to a file in this directory based on the table name.

There are a couple options for this regarding how you are Subscribing. You can place this tag at the Agent level - to cover all tasks, or at the task level - to have unique directories per task.

Example

Task Level

This is placing the tag within the <task> brackets. Defining it explicitly (or avoiding it) for each task. You will do this if you want to configure different error directories per task / queue.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
    <agent>
        <subscribe>
            <task>
                <task_name>example_subscribe_foo</task_name>
                <message_connection user="example" password="XXXX" queue="YYYY">amqps://example.perspectium.net</message_connection>
                <instance_connection user="foo" password="XXXX">https://foo.service-now.com</instance_connection>
                <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
                ....
                <error_directory>../errorsFoo</error_directory>            
            </task>
 
            <task>
                <task_name>example_subscribe_bar</task_name>
                <message_connection user="example" password="XXXX" queue="ZZZZ">amqps://example.perspectium.net</message_connection>
                <instance_connection user="bar" password="XXXX">https://bar.service-now.com</instance_connection>
                <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
                ....
                <error_directory>../errorsBar</error_directory>
            </task>
        </subscribe>
 
        <max_reads_per_connect>2000</max_reads_per_connect>
        <polling_interval>5</polling_interval>
    </agent>
</config>

Agent Level

This is putting the tag at the <agent> level to have all the tasks inherit this behavior. You will do this if you just want one single error directory for all your tasks / queues.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
    <agent>
        <subscribe>
            <task>
                <task_name>example_subscribe_foo</task_name>
                <message_connection user="example" password="XXXX" queue="YYYY">amqps://example.perspectium.net</message_connection>
                <instance_connection user="foo" password="XXXX">https://foo.service-now.com</instance_connection>
                <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
                ....         
            </task>
 
            <task>
                <task_name>example_subscribe_bar</task_name>
                <message_connection user="example" password="XXXX" queue="ZZZZ">amqps://example.perspectium.net</message_connection>
                <instance_connection user="bar" password="XXXX">https://bar.service-now.com</instance_connection>
                <handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
                ....
            </task>
        </subscribe>
 
        <error_directory>../errors</error_directory>
        <max_reads_per_connect>2000</max_reads_per_connect>
        <polling_interval>5</polling_interval>
    </agent>
</config>

Directories

Upon startup the Agent will create the necessary directories and will populate them with the log files as necessary.

Example below:

replicator_agent_error_directory.txt · Last modified: 2018/11/01 14:43 by jackson.davenport