Bzip2 Modules

Properties   Config Settings  

The Bzip2 transformer implements a Bzip2-compliant compressor and decompressor.

Remarks

The Bzip2 module adds compression and decompression capabilities to your Mule Project. The Bzip2 file format is typically used only to archive a single file. Accordingly, the operation of the module is simpler than that of other modules.

Bzip2 Compressor Module

The Compressor requires an Array of uncompressed data as input, e.g. Array<InputStream>. The binary elements of the input list are compressed into a single binary file and added to the output payload.

Compress Example

To get started, add a File List connector in front of the Bzip2 Compress module and configure it to point to a target Directory Path. There is no need to transform the output of the File List connector before passing it to the Bzip2 Compressor. That is all that is required to get started. You can optionally add a File Write connector behind the Bzip2 Compress operation to write the bzip2-formatted file to disk when processing completes.

Note: To compress a single file, use a File Read connector in front of the Bzip2 Compress module instead of File List. You will need to transform the output into a list before passing it to the module. You can transform the output to a list by setting the Entries property of the Bzip2 Compress module to the following DataWeave code:

output application/java --- [payload]

Bzip2 Decompressor Module

The Decompressor takes in binary compressed data as input. The output is an Array containing the decompressed contents of each original file. The Array elements can be accessed with a For Each scope. Note that filenames are not be preserved because Bzip2 is a data compression algorithm and not a file archiver.

Decompress Example

To get started, add a File Read connector in front of the Bzip2 Decompress module and configure it to read a bzip2-formatted file. Add the Bzip Decompress module behind it and that's it. Then you can use a For Each Scope to access each element. For example, add a For Each Scope behind the Bzip2 Decompress operation and set the collection field to payload. Then inside the For Each Scope the decompressed data is available in the payload.

Compressor Property List


The following is the full list of the properties of the compressor Module with short descriptions. Click on the links for further details.

LogFileThe file to write logging information to at runtime.
LogModeWhat information gets logged during component execution.
LogTypeHow information gets logged during component execution.
OtherDefines a set of configuration settings to be used by the transformer.
RuntimeLicenseSpecifies the component runtime license key.
TempPathA temporary directory where uncompressed and compressed data can be stored.

Decompressor Property List


The following is the full list of the properties of the decompressor Module with short descriptions. Click on the links for further details.

LogFileThe file to write logging information to at runtime.
LogModeWhat information gets logged during component execution.
LogTypeHow information gets logged during component execution.
OtherDefines a set of configuration settings to be used by the transformer.
RuntimeLicenseSpecifies the component runtime license key.
TempPathA temporary directory where uncompressed and compressed data can be stored.

Config Settings


The following is a list of config settings for the Module with short descriptions. Click on the links for further details.

MergeExtractedDataIf true, the component will merge concatenated data into one output file when decompressing.

LogFile Property (Bzip2 Module)

The file to write logging information to at runtime.

Data Type

String

Default Value

""

Remarks

To write logging information to a file instead of using the connector's logging API, set this property to a valid file on disk and set the LogType property to "File".

LogMode Property (Bzip2 Module)

What information gets logged during component execution.

Data Type

Enumeration

Possible Values

Verbose (0)
Info (1)
Warning (2)
Error (3)
Fatal (4)


Default Value

3

Remarks

This property controls what information the connector logs. The possible values have the following affect on the connector's behavior:

VerboseThe connector will report all information regarding the transport.
InfoThe connector will report all major operations, as well as all warnings and errors.
WarningThe connector will report any conditions that could result in unpredictable behavior as well as errors.
ErrorThe connector will report all errors that prevent normal operations from completing.
FatalThe connector will report only serious errors that cause the connector to completely stop functioning.

LogType Property (Bzip2 Module)

How information gets logged during component execution.

Data Type

Enumeration

Possible Values

None (0)
Console (1)
File (2)


Default Value

1

Remarks

This property controls where the connector will log the information. The possible values have the following affect on the connector's behavior:

NoneThe connector will not report any logging information.
ConsoleThe connector will report all logging information to the console.
FileThe connector will report all logging information to a file. The desired file must be specified in the LogFile when this type has been selected.

Other Property (Bzip2 Module)

Defines a set of configuration settings to be used by the transformer.

Data Type

String

Default Value

""

Remarks

The module accepts one or more configuration settings. These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the module, access to these internal properties is provided through the Other property.

The Other property may be set to one or more configuration settings (name/value pairs). Set one setting per line. For example: configname1=value1 configname2=value2

RuntimeLicense Property (Bzip2 Module)

Specifies the component runtime license key.

Data Type

String

Default Value

""

Remarks

You can use the RuntimeLicense property to set the runtime key for the connector license.

TempPath Property (Bzip2 Module)

A temporary directory where uncompressed and compressed data can be stored.

Data Type

String

Default Value

""

Remarks

This property indicates a temporary directory where the module can store any data before the module processes it. If TempPath is empty, the module will receive all data to memory. If set, the module will generate and write all inbound data to a temporary file in the specified directory.

Once the file is submitted to BizTalk, the module will handle closing the file stream and deleting the temporary file. However, if the module is shut down during a transfer some temporary files may be left in the directory. To ensure optimal performance, server administrators should check the directory regularly and remove old or extraneous files.

This property accepts the "%TEMP%" macro, which will be replaced with the default system temporary directory at runtime.

Note: by default, this property is empty and the module will use memory streams to store all inbound data before submitting it to BizTalk. It is recommended that you use a temporary directory when downloading large batches or batches containing large files to alleviate potential increased memory requirements.

Config Settings (Bzip2 Module)

The connector accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the connector, access to these internal properties is provided through the Other property.

Bzip2 Config Settings

MergeExtractedData:   If true, the component will merge concatenated data into one output file when decompressing.

While the bzip2 file format is typically used only to archive a single file, multiple files can be concatenated into one bzip2 file. This configuration setting can be used to into one output file when decompressing.