Configuring Java CAPS JBI Components for GlassFish Clustering

ProcedureTo Configure the File BC WSDL File for Clustering

  1. For outbound messages, do the following:

    1. In the File BC WSDL document, scroll to the input message definition under Bindings (named file:message, by default).

    2. Select file:message.

      The Properties panel displays the properties for the message.

    3. In the FileName property, enter a name for the output file using either %u to assign a unique UUID number to each output file or %{seq_name} for persisted sequence number creation. For example, output%u.txt.


      Note –

      Do not use %d in the file name. It does not ensure a unique file name and files might be overwritten.


    4. In the fileNameIsPattern property, enter true.

    5. Save and close the WSDL file.

  2. For on-demand, read-only messages, you can configure any of the following options:

    1. In the File BC WSDL document, scroll to the input message under Bindings (named file:message, by default).

    2. Select file:message.

      The Properties panel displays the properties for the message.

    3. Do one of the following:

      • To allow multiple instances and processes to access the input file, set the value of the deleteFileOnRead property to false.

      • To ensure only one thread and one process accesses the file, set the value of the deleteFileOnRead property to true.

        This deletes inbound on-demand messages once they are read.

    4. If deleteFileOnRead is set to true, do one of the following:

      • To retain a copy of the deleted files, set the value of the archive property to true and specify an archive directory.

        The files are removed from the input directory and are copied to the archive directory with a UUID appended to the name to ensure it is unique. This retains a history of the files that have been processed.

      • To simply delete the files once they are read, set the value of the archive property to false.

  3. For inbound messages, use the file locking mechanism of the File BC to ensure that each inbound file is picked up only once by one instance in the cluster.

    Use the following attributes to implement the locking mechanism:

    • file:address/@lockName - The file name used for the F_LOCK.

    • file:address/@workArea - The name of the working directory.

    • file:address/@seqName - The name of the directory where all sequence numbers are saved.

    • file:address/@persistenceBaseLoc - The name of the directory where the lock files are stored.

    For more information, see Configuring File BC WSDL Attributes in Using the File Binding Component in a Project (under File Address Element) and Inbound Message Processing in Using the File Binding Component in a Project.