Enterprise Manager - File System: Asynchronous Triggers


Access to this feature requires an active Software Asset Management (SAM) subscription. See Benefits of ‘Software Asset Management' Feature Line.


In BBj 15.0 and higher, an asynchronous trigger job consists of a list of directories and/or files monitored by the BBj filesystem. When a write or remove operation occurs on a monitored file, a BBj program runs on the specified target machine in response to the operation. This program has access to the information provided by the file operation such as the record data, key data, user, IP address, etc.

Asynchronous Triggers vs. File Triggers

Asynchronous triggers differ from standard file triggers in that the file operation does not wait for the trigger operation to complete before continuing. This means there is almost no overhead on the file system. Furthermore, these triggers can be configured to run on a remote BBjServices installation to allow the administrator to distribute the interpreter workload to another machine. As with file triggers, asynchronous triggers can execute any valid BBj code or embedded Java code that does not utilize any user interface related operations.

How Do They Work?

When a write or remove operation occurs on a monitored data file, a record of the operation is put into a queue for processing. The operations are processed in a FIFO (first in, first out) pattern. The queue persists between restarts of both the source and target instances of BBjServices (see BBj File Replication). When the target machine receives an operation to process, it launches the appropriate BBj program:

  • Write Program -  Executed when the source performs a WRITE, WRITE RECORD, SQL UPDATE, or SQL INSERT operation.
  • Remove Program - Executed when the source performs a REMOVE or SQL DELETE operation.

Asynchronous Trigger Jobs Panel

Under the “File System” node in the EM Navigator, double click on the “Asynchronous Trigger Jobs” node to open up a list of all currently configured jobs.

 


Pause

Click the  button to pause the job. Pausing the job means that it will continue to queue up operations, but those operations will not be sent to the target for processing until the job is resumed.

Pause When Caught Up

Click the  button to cause the job to pause as soon as all of the operations in the queue have been processed. Until the queue is empty, operations will continue to be processed.

Cancel Pause When Caught Up

Click the  button to cancel “pause when caught up” if it is currently in that state.


Creating a New Job

Asynchronous trigger jobs can be created using the BDT Enterprise Manager or the Admin API. For information on managing asynchronous trigger jobs from the Admin API, see the Admin API Javadocs for BBjAdminBase and for BBjAdminAsynchTriggerJob.

Using the Enterprise Manager to Manage Jobs

Click on the [Add] button to launch the new job wizard:

Asynchronous Trigger Job Name

A short meaningful name for the job.

Monitor a [job type]

Click the radio button of the type of job to build; either create the job from a

  • Named Database Instance
  • List of one or more data files and directories (manually specify the list)

Using a named database instance populates the list of files and directories from the database configuration to ensure that all data dictionary and data files are monitored.



Database Name

A short meaningful name for the job.




Host Name

Machine name or IP address of the target machine. The triggered BBj programs will run on this machine.

Port

The port number running the Filesystem Server on the target machine. This is typically 2000.

User Name

User name to use to connect to the target machine.

Password

Password for the user.

User SSL

Put a check here if the target machine’s Filesystem Server is currently configured to use SSL. This setting MUST match the setting on the target server.

Test Settings

Once the settings are configured, click this button to test the settings.



Write Program

Full path to the BBj program to run when a write operation occurs on a monitored file. Writes from the BBx language or from SQL operations will fire the trigger

Remove Program

Full path to the BBj program to run when a record is removed from a monitored file. Removes from the BBx language or from SQL operations will fire the trigger.

Config File

Full path to the working directory used by the trigger interpreter. Leave blank to use the default working directory for the target BBjServices installation.


The “Included Directories and Files” page provides a list of files to be monitored. Users can include an entire directory or individual files.


 

The “Excluded Subdirectories and Files” page gives users the ability to exclude specific files from directories present in the included list. This is useful when it is easier to include an entire directory and only exclude a small number of files.


Click [Finish] to create the new job.