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 |
|---|---|---|---|
|
|
string |
zip |
Defines the compression format. Allowed values are |
|
|
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:
XML
<route>
<from uri="direct:start"/>
<to uri="pfx-io:compress?compressionType=zip&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.
XML
<route>
<from uri="direct:start"/>
<to uri="pfx-io:compress/>
</route>