pfx-io:compress

This method takes body of a message and compresses it using ZIP or GZIP format. It then stores the compressed content in memory (or in StreamCache if it is enabled) or into a file if path is specified.

Properties

Option

Type

Default

Description

Option

Type

Default

Description

compressionType

string

 zip

Defines the compression format. Allowed values are zip and gzip.

compressedFileOutputPath

string

 

If specified, compressed contents are stored to a file with the given path (instead of memory or stream cache).

Examples

The following example will take what is in body as InputStream, and save the zipped content in a file:

<route> <from uri="direct:start"/> <to uri="pfx-io:compress?compressionType=zip&amp;compressedFileOutputPath=/tmp/out-test.csv.zip"/> </route>

The following example will use the zip format by default and will store the zipped content in memory OR in streamCache if it is enabled.

<route> <from uri="direct:start"/> <to uri="pfx-io:compress/> </route>

IntegrationManager version 5.8.0