Using the File Binding Component in a Project

Persisted Sequencing

The symbol % { <seq_name}() indicates a reference to a persisted sequence number by name, where the sequence numbers's current value is incremented by one and the reference is substituted.

The lexical definition is: <seq_name> =: (0–9a-zA-Z-_) + ()

The current sequence value is persisted so that it survives if the application is shutdown or undeployed, or if the JBI container (application server) is shutdown.

Mapping Persisted Sequences to File Based Persistences

A file is used as the persistence storage of sequences. For a File Binding Component service, as defined in a WSDL, the scope of the sequences are the endpoints associated with the bindings that contain the references to these sequences. As displayed in the following WSDL, there are two bindings which reference sequences by the name seq-v.1.

The mapping of a sequence to a file system file is demonstrated in the WSDL file below.

Mapping of a Sequence to a File System

In this example, %{se-v.1}() gives reference to a different sequence number when it appears in different bindings.

The persisted storage for a sequence is a file with the same name under the directory specified by the file:address->fileDirectory of the corresponding service binding.

For example, in the above WSDL, the persisted files are:

Initial Value of a Persisted Sequence

The initial value of a persisted sequence is 0. The value is then incremented by 1 every time that sequence is referenced. To create a sequence the starts with a number that is greater than zero, edit the start value in the persisted storage file when the file is not in use.

Concurrence Control of Access to the Sequence Storage File

Access to a specific sequence in persistence storage file is thread and clustering safe. This means that the file is read and updated by a single thread across clustered servers and JVMs, this can be on one host or multiple hosts.

Outbound Message Processing

Outbound message processing always utilizes File Name Patterns to ensure that messages are processed once only and are not overwritten.

The life cycle of an outbound message can be explained using the following illustration.

Outbound Message Processing

The process flow can be described by the following steps:

  1. Outbound processors wait on the Normalized Message Router for outbound messages. The number of available outbound processors is configured by the runtime parameter Outbound Threads().

  2. When an outbound message is available, an outbound processor takes the message, denormalizes the message, and writes the message payload to the specified file destination.

  3. A file name pattern is used to generate the unique message name. The file name pattern is specified by the WSDL File message element attribute fileNameIsPattern().

For example, a UUID can be added to the file name using the following value: output._%u.dat(). When persisted sequence numbering is used to provide a file name pattern, the outbound processor reads the sequence number from the my_sequence directory and adds this number to the file name. It then increments the number by one and writes the new number back to the my_sequence directory. This process is synchronized so that only one outbound process can access the my_sequence directory at any time, ensuring that the persisted sequence number retains its integrity.