Locking Mechanism
The locking mechanism implementation process is explained in this topic.
Procedure
- When a timer task starts processing, it tries to acquire a lock.
- If it finds a lock file, it skips processing.
-
If a lock file is not found, a lock file is created and the Node ID information of the server is added to the lock file. The lock files are created in the following directories:
- MqRevivify: $MQ_HOME/Work/MqRevivify.lock
- FileWatcher: Location can be specified in the
FileWatcher.xml file.
Note: If multiple files are being processed (using Filewatcher), ensure the lock file is enabled in the filewatcher.xml file (enabled by default).
The lock file contains the local host information so that the host JVM that created it can be identified. It contains the application Node ID and host identifier. This needs to be done so that only the owner can purge the file later.
- After the task is completed, the lock file is deleted.
Copyright © Cloud Software Group, Inc. All rights reserved.