User Tools

Site Tools


servicenow_direct_advanced

ServiceNow Direct

Bismuth

ServiceNow Direct enables the replicator agent to consume messages directly from a ServiceNow instance. This is an advanced feature and should be implemented with the help of the Perspectium support team. You can contact them at: support@perspectium.com

Usage

The easiest way to use ServiceNow Direct after installation is to click the ServiceNow Direct module located at Perspectium → Replicator which will provide a ready to run configuration form for generating the correct share configurations. It will also download a zip file containing the files required to run the agent.

Because the agent will be consuming messages directly from the outbound table, you do not need to specify a target queue.

ServiceNow Setup

1. Ensure your Perspectium for ServiceNow core update set is at least version Bismuth or higher. You can check your update set version in Perspectium → Control and Configuration → Properties. If your update set is below this threshold, please contact the Support team for instructions on upgrading.

2. Download and install the ServiceNow Direct update set to enable direct functionality.

3. Download and install the Perspectium Replicator Agent version Bismuth or higher.

4. In your ServiceNow instance, navigate to Perspectium → Finish Install and run the processing action.

5. In your ServiceNow instance, enter u_psp_properties.list in your module search bar and find the record with the Name field com.perspectium.replicator.servicenow_direct and set the Value field to true. Note: Setting this value to true will allow dynamic and bulk shares to put all outbound messages in the psp_out_message table instead of separating audit and attachment messages into their own outbound tables. This way the ServiceNow Direct agent can process all records since it only reads from the psp_out_message outbound table.

Replicator Agent Configuration

The following fields and traits need to be set in order to activate ServiceNow Direct mode for the agent. See below for a reference Agent.xml to use as a template.

1. <message_connection> should imitate <instance_connection> values. (see sample)

2. <task instances> should be set to a value of “1” (default value is “4”)

3. <servicenow_subscriber> should be set to true

Sample Agent.xml

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
  <agent>
    <subscribe>
      <task instances="1">
        <task_name>test_task</task_name>
        <message_connection password="encrypt:password" use_basic_consume="true" user="user">https://myinstance.service-now.com</message_connection>
        <instance_connection password="encrypt:password" user="user">https://myinstance.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></database_user>
        <database_password></database_password>
        <database_params>characterEncoding=UTF-8</database_params>
        <database>database_name</database>
      </task>
    </subscribe>
    <servicenow_subscriber>true</servicenow_subscriber>
    <max_reads_per_connect>4000</max_reads_per_connect>
    <polling_interval>5</polling_interval>
    <skip_message_set_processing/>
  </agent>
</config>

Changes made by ServiceNow Direct Update Set

ServiceNow Direct makes some small changes to some of the core scheduled jobs. If you would like to restore normal Perspectium functionality these changes will need to be reversed.

Scheduled Job Field Old Value New Value
Perspectium Replicator Inbound Processor Name XPerspectium Replicator Inbound Processor Perspectium Replicator Inbound Processor
Perspectium Replicator Inbound Processor Active false true
XPerspectium Replicator Subscriber Name Perspectium Replicator Subscriber XPerspectium Replicator Subscriber
XPerspectium Replicator Subscriber Active true false
XPerspectium MultiOutput Processing Name Perspectium MultiOutput Processing XPerspectium MultiOutput Processing
XPerspectium MultiOutput Processing Active true false

Multiple Direct Agents

Dubnium

By default, the agent in ServiceNow Direct mode will read the oldest unprocessed “ready” messages in the instance's outbound table, process them in the database and then mark them as processed in the outbound table.

So in this scenario, running multiple agents against the same ServiceNow instance to enhance throughput will lead to agents reading the same messages because the messages are not marked as processed until they've been processed at the database.

In order to support multiple agents, we can leverage the built-in queue feature in the Perspectium Replicator solution. This will require some configuration on both your ServiceNow instance and the agent as described below.

ServiceNow Shared Queues

In your ServiceNow instance, create shared queues and specify each as an appropriate target queue for each of your bulk and dynamic shares. That is, if you want to have two agents running against your instance, you should create two queues and then have your bulk and dynamic shares use these queues as appropriate to distribute the data.

For example, you can create the shared queues psp.out.replicator.agent_name1 and psp.out.replicator.agent_name2 and then use one queue in some of your dynamic and bulk shares and then the other queue in the other dynamic/bulk shares.

Replicator Agent Queue Attribute

You can configure each agent to read messages from the outbound table for one queue only and avoid the aforementioned issue of reading the same messages.

In your agent.xml configuration file, specify the name of the previously created shared queue as the queue attribute of <message_connection>. For example, using the above example, we could update one agent's configuration file to have the queue attribute psp.out.replicator.agent_name1:

<message_connection queue="psp.out.replicator.agent_name1" password="encrypt:password" user="user" >https://myinstance.service-now.com</message_connection>

And then in the other agent's configuration file have the queue attribute as psp.out.replicator.agent_name2.

servicenow_direct_advanced.txt · Last modified: 2018/08/01 20:38 by paul