Prevent duplicate message import

To avoid duplicate message import, KC Plug-In provides a locking mechanism. In this, KC Plug-In create files named with a unique ID returned by Message Connector in the ReceiveMessage call. The file is created on a local or network folder as configured. This folder must be common for all the configured KC Plug-In applications.

By default, KC Plug-In uses the folder defined in the Kofax Capture's registry key "ServerPath" as root path and under the root path it creates a folder "KofaxImportConnector\LockFileStore".

Additionally, the path is also configurable at <LockStorePath> element of the Kofax Import Connector's configuration XML file. If <LockStorePath> is configured, Kofax Capture's "ServerPath" registry key is ignored. The registry key "ServerPath" is used only if the <LockStorePath> element is empty (default).

Initially, KC Plug-In verifies whether the file with the received ID already exists. If the file does not exist, it will create the lock file and continue processing the message. The message gets the status "Retrieved and queued". If the file already exists, KC Plug-In will check if the file is exclusively locked. If it is locked, this means that another KC Plug-In instance is processing the message, therefore KC Plug-In will do nothing with this message and continue fetching the next message.

Following is the list of codes and corresponding description of message status in the lock file.

Code

Description

Result

10

Retrieved and queued

Message has been retrieved from MC and is in KC Plug-In, in the message queue waiting to be processed into Capture.

20

Processing into Capture

The message is being imported into Capture. This status is set after the create batch operation when the message files are being imported.

30

Closing batch

All messages have been imported and the close batch operation is in progress

50

Import OK

Close batch has successfully completed

60

Retry confirm - Confirm failed and the Confirm call is scheduled for retry (for example, Message Connector is down when KC Plug-In tries to confirm the message)

Close batch succeeded, but Confirm message failed. KC Plug-In instance that imported the message schedules five more retries every five minutes.

70

Confirm Pending

Retry Confirm did not succeeded for 5 times. The status is updated to Confirm Pending and any KC Plug-In instance that eventually receives a message with this ID will retry to confirm it.

100

OK

Close batch and Confirm message back to Message Connector have successfully completed.

By default, the locking mechanism is disabled. To enable it, do the following:

  1. Start the KC Plug-In configuration, open any connection and click OK.
  2. Close the KC Plug-In configuration.
  3. Edit the file C:\ProgramData\Kofax\KIC-ED\KCPlugIn\config\KIC-ED-KCPlugIn.xml. Search for the <LockStoreEnabled> element. In <LockStoreEnabled>false</LockStoreEnabled>. Replace 'false' with 'true'.

    It should look similar to: <LockStoreEnabled>true</LockStoreEnabled>.

  4. To avoid duplicates from Right fax, set the element <LockStorePreferSourceTransferID> value to true.

    It should look similar to: <LockStorePreferSourceTransferID>true</LockStorePreferSourceTransferID>.

  5. Save the XML file.
  6. Restart KC Plug-In.

The lock folder path length (excluding the filename length) must not exceed 200 characters. It assumes that the length of the RightFax Unique-ID (which is generally 15 characters) is less than 20 characters. In the unlikely case that the RightFax Unique-ID is longer, the maximum lock folder path length decreases accordingly.

By default, the Kofax Import Connector will use the file path defined in Capture's registry key "ServerPath". Under this path, it will create a folder "KofaxImportConnector\LockFileStore".