# mulesoft Compression Module - Full Documentation
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Archive and Extract Example
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The following Compression module example shows how to archive and extract files from a folder. The
File Connector **List** operation lists all the files from a folder named `input`. The **Compress**
operation then creates a compressed archive by generating an object with the key set to the file
name and the value set to the value of the listed files. Subsequently, the **Extract** operation
decompresses the archived file. Then, the **For Each** scope iterates over each extracted key/value
pair and writes the file to a new output folder with the key as the new file name and the value as
the corresponding extracted file content.
1. In Studio, drag a **Scheduler** trigger to the flow.
2. Set **Frequency** to `15` and **Time unit** to `SECONDS`.
3. Drag the **List** operation alongside the **Scheduler** trigger.
4. Add the connector configuration.
5. Set **Directory path** to `input`.
6. Drag a **Set payload** component alongside the **List** operation.
7. Set **Value** to the following DataWeave expression:
```dataweave
output application/java
---
(0 to sizeOf(payload) - 1) as Array
reduce (index, acc={}) ->
acc ++ { (payload[index].attributes.fileName): payload[index].payload}
```
8. Drag the **Archive** operation alongside the **Set payload** component.
9. Drag the **Extract** operation alongside the **Archive** operation.
10. Drag the **For Each** scope.
11. Set **Collection** to `payload`.
12. Drag the **Write** operation into the **For Each** scope.
13. Set **Path** to `#[output application/json--- "output/" ++ (payload pluck $$)[0]]`.
14. Set **Content** to `[CDATA[#[output application/java --- ( payload pluck $ )[0]]]`.
15. Drag a **Logger** component right to the **For Each** scope.
16. Set **Message** to `output application/json --- payload`.
17. Save and run your Mule app.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Archiving and Extracting Files
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The Compression module provides the **Archive** operation that enables you to compress a set of
entries into a new archive file and the **Extract** operation that enables you to decompress content
that represents an archive file.
## Configure Archive Operation
Given an input stream payload, the **Archive** operation enables you to compress all the payload
entries into a new archive file in the Zip format. The operation receives a map that identifies the
values to compress. Then, the operation receives each entry, which is placed inside the compressed
archive file with the entry name you provide in a DataWeave expression.
1. In Studio, drag the **Archive** operation to your flow.
2. Set **Entries** to a DataWeave script defining each name of the entry to compress as a key and
the content of that entry as its value, for example:
```dataweave
{
summary.pdf: vars.summary,
'details/result_001.pdf': vars.file1
'details/result_002.pdf': vars.file2
}
```

In the **Configuration XML** editor, the configuration looks like this:
```xml
#[
{
summary.pdf: vars.summary,
'details/result_001.pdf': vars.file1
'details/result_002.pdf': vars.file2
}
]
```
The resulting archive contains three entries:\`summary.pdf\`, located at the root level and
`result_001.pdf` and `result_002.pdf`, located in the `details` directory.
```none
+- content.zip
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
Note that the slash `/` in the name of an entry, for example, `details/result_001.pdf`, indicates a
directory separation. All names are introspected to create directories inside the archive.
> [!NOTE] If you create the input to the **Archive** operation using a DataWeave expression, the
> DataWeave expression must output an object used to build the Java map object. Define unique keys
> to add the entire object to the archive.
## Configure ZIP64 Archiver Strategy
An archiver strategy compresses multiple entries into an archive. The Zip archiver strategy declares
that the content must be compressed using the Zip format. In Studio, the **Archiver** field is set
by default. To archive files and byte arrays greater than 4 GB, select the **Force ZIP64** field.
1. In Studio, select the **Archive** operation from your flow.
2. Set the **Entries** field to the following expression, for example:
```DataWeave
output application/java
---
(0 to sizeOf(payload) - 1) as Array
reduce (index, acc={}) ->
acc ++ { (payload[index].attributes.fileName): payload[index].payload}
```
3. Select **Force ZIP64**.

In the **Configuration XML** editor, the `zip-archiver` and `forceZip64` configuration look like
this:
```xml
acc ++ { (payload[index].attributes.fileName): payload[index].payload}]]]>
```
## Configure Extract Operation
The **Extract** operation enables you to decompress content that represents an archive in some
compression format. The entries of the archive file are returned as objects, each accessible by its
entry name.
1. In Studio, select the **Extract** operation from your flow.
2. Set the **Compressed** field to `vars.archive`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
#[vars.archive]
```
Now, assume that you decompress an archive with three entries that contain the following structure:
```none
+- Archive
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
In this case, you can access the extracted contents of the entries using: `payload['summary.pdf']`
or `payload.details['result_001.pdf']`
## Configure Zip Extractor Strategy
An extractor strategy decompresses an archive with multiple entries that are compressed in a
particular format. The Zip archive strategy declares that the content must be extracted with the Zip
format. In Studio, the **Extractor** field is set by default.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compress and Decompress Example
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The following Compression module examples show how to compress a file using the **Compress**
operation and decompress a payload from a remote service using the **Decompress** operation.
## Compress a File
In the following example, you configure the File Connector **Read** operation to read a file. Then,
the **Compress** operation compresses the file and saves it in GZip format. Subsequently, the File
Connector **Write** operation writes the content into the given path on demand.
1. In Studio, drag the File Connector **Read** operation to your flow.
2. Set **Path** to `file.txt`.
3. Drag the **Compress** operation alongside the **Read** operation.
4. Set **Compressor** to **Gzip compressor**
5. Drag the **Write** operation alongside the **Compress** operation.
6. Set **Path** to `file-txt.gz`.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## Decompress a Payload from a Remote Service
In the following example, you configure the Web Service Consumer Connector **Consume** operation to
consume an operation that returns a Zip file from a server. Then, the **Decompress** operation
decompresses the Zip file.
1. In Studio, drag the Web Service Consumer Connector **Consume** operation to your flow.
2. Set **Connector configuration** to your operation configuration, for example `ZipServiceConfig`.
3. Set **Operation** to the name of the web service operation to invoke, for example `returnsZip`.
4. Drag the **Decompress** operation alongside the **Consume** operation.
5. Set **Content** to `payload.body.zipContent`.
6. Set **Compressor** to **Zip compressor**.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compressing and Decompressing a Single File
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The Compression module provides the **Compress** and **Decompress** operations that enable you to
compress or decompress a single file in the configured Gzip or Zip format.
## Configure Compress Operation
Given an input stream payload, the **Compress** operation enables you to compress the stream and
return a new compressed stream of bits. You can then store the compressed stream of bits in a file
system or transfer it to another system.
1. In Studio, drag the **Compress** operation to your flow.
2. Set **Content** to your input stream payload to compress.
3. Set **Compressor** to **Gzip compressor** or **Zip compressor** strategy.

In the **Configuration XML** editor, the configuration looks like this:
```xml
#[payload.data]
```
## Configure GZip Compressor Strategy
A compressor strategy compresses a file or a single-entry archive. The **Gzip compressor** strategy
declares that the content must be compressed in the Gzip format.
1. In Studio, select the **Compress** operation from your flow.
2. Set **Compressor** to **Gzip compressor**.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## Configure Zip Compressor Strategy
The **Zip compressor** \*strategy declares that the content must be compressed in the Zip format.
1. In Studio, select the **Compress** operation from your flow.
2. Set **Compressor** to **Zip compressor**.
3. Select **Force ZIP64** to compress files and byte arrays greater than 4 GBs.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## Configure Decompress Operation
The **Decompress** operation enables you to decompress a single-entry compressed content, which is
an archive in a specified compression format. Compressed archives can have multiple entries, but
this operation manages only single entry archives because if the archive contains more than one
entry, the operation does not know which to return. For multiple entry archives, use the **Extract**
operation, which enables you to choose only formats that accept multiple entries.
1. In Studio, drag the **Decompress** operation to your flow.
2. Set **Compressed** to your input stream payload to decompress.
3. Set **Decompressor** to **Gzip decompressor** or **Zip decompressor** strategy.

In the **Configuration XML** editor, the configuration looks like this:
```xml
#[payload]
```
## Configure GZip Decompressor Strategy
A decompressor strategy decompress a file or a single-entry archive. The **Gzip decompressor**
strategy declares that the content must be decompressed with the Gzip format.
1. In Studio, select the **Decompress** operation from your flow.
2. Set **Decompressor** to **Gzip decompressor**.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## Configure Zip Decompressor Strategy
The **Zip decompressor** strategy declares that the content must be decompressed with the Zip
format.
1. In Studio, select the **Decompress** operation from your flow.
2. Set **Decompressor** to **Zip decompressor**.
In the **Configuration XML** editor, the configuration looks like this:
```xml
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.0
---
# Compression Module
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression Module v2.0
Compression Module supports and provides access to the most-used file archiver and compression
formats through a Mule app.
A file archiver is a computer program that combines a number of files together into one archive file
for easier transportation or storage, and most archivers employ data compression in their archive
formats to reduce the size of the final archive. However, not all compression algorithms can archive
multiple files. Some are limited to single-file data compression.
This module compresses and decompresses files for each of the available formats without losing any
of the features that the format associated algorithm provides.
To achieve this capability, the module provides two pairs of operations, one for compressing and
decompressing a single file, another for archiving and extracting a bundle of files. Each of these
operations can be configured with the compression or archiving strategies of your choice.
Release Notes:
[Compression Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-compression)
Exchange: [Compression Module](https://www.mulesoft.com/exchange/org.mule.modules/mule-compression-module/)
## POM File Information
If you create an app outside of Studio, set your POM file information as follows:
```xml
org.mule.modules
mule-compression-module
x.x.x
mule-plugin
```
Replace `x.x.x` with the version that corresponds to the connector you are using.
## Compress and Decompress a Single File
### Content Compression
Given an input stream, the module compresses the stream and returns a new compressed stream of bits
so it can be stored in a file system or transferred to another system.
#### Compressor Strategies
A Compressor strategy can compress a file or a single-entry archive.
##### GZip Compressor Strategy
When used in an operation, this strategy declares that the content should be compressed with the
`gzip` format.
```xml
```
##### Zip Compressor Strategy
When used in an operation, this strategy declares that the content should be compressed with the
`zip` format.
```xml
```
#### Compress Operation
```xml
#[payload.data] (1)
(2)
```
| 1 | The InputStream to be compressed. Defaults to #[payload]. |
| 2 | Compressor strategy to be used. |
#### Compression Errors
If an error occurs while compressing the content, a `COMPRESSION:COULD_NOT_COMPRESS` error is
thrown.
## Content Decompression
Decompresses single-entry compressed content, which is assumed to be an archive in the specified
compression format.
### Decompressor Strategies
A Decompressor strategy knows how to decompress a file or a single-entry archive.
#### GZip Decompressor Strategy
When used in an operation, this strategy declares that the content should be decompressed with the
`gzip` format.
```xml
```
#### Zip Decompressor Strategy
When used in an operation, this strategy declares that the content should be decompressed with the
`zip` format.
```xml
```
### Decompress Operation
```xml
#[payload] (1)
(2)
```
| 1 | The InputStream to be decompressed. Defaults to #[payload]. |
| 2 | Decompressor strategy to be used. |
#### Decompression Errors
If the given content does not match the format of the configured strategy, a
`COMPRESSION:INVALID_ARCHIVE` error will be thrown.
If the archive to be decompressed has more than one entry, this operation will fail with a
`COMPRESSION:TOO_MANY_ENTRIES` error, because it will not be able to choose only one entry to
return. For these cases, you should use the Extract operation.
## Archive and Extract Multiple Entries
### Archive
Given a Map of ``, the archiving process compresses all the given entries
into a new archive in the configured format.
#### Archiver Strategies
An Archiver strategy is for compressing multiple entries into an archive.
##### Zip Archiver Strategy
When used in an operation, the Zip Archiver strategy declares that the content should be compressed
with the `zip` format.
```xml
```
### Archive Operation
This operation receives a Map that identifies the entries to be compressed and their values. Each
entry passed to this operation is placed inside the compressed archive bearing the name you provide.
```xml
(1)
#[
{
summary.pdf: vars.summary,
'details/result_001.pdf': vars.file1
'details/result_002.pdf': vars.file2
}
]
(2)
```
| 1 | A DataWeave script defining each name of the entry to be compressed as a key and the content of that entry as its value. |
| 2 | The archiver strategy to be used. |
The resulting archive contains _three entries_, one named `summary.pdf` at root level, the others
called `result_001.pdf` and `result_002.pdf`, inside a directory called `details`:
```none
+- content.zip
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
Note that the slash (`/`) in the name of an entry (for example, `details/result_001.pdf`) indicates
directory separation, so all names will be introspected to create directories inside the archive.
> [!NOTE] If you create the input to the Archive operation using a DataWeave expression, the
> DataWeave expression must output an Object, which is used to build the Java Map object. For the
> entire object to be added to the archive, every key must be unique.
#### Archive Errors
If a problem occur while compressing the content, a `COMPRESSION:COULD_NOT_COMPRESS` error will be
thrown.
## Extract
Decompresses content that represents an archive in some compression format.
### Extractor Strategies
An Extractor strategy can decompress an archive with multiple entries that are compressed in a
particular format.
#### Zip Strategy
When used in an operations, this strategy declares that the content should be extracted with the
`zip` format.
```xml
```
### Extract Operation
```xml
#[vars.archive] (1)
(2)
```
| 1 | The compressed content to be extracted. Defaults to #[payload]. |
| 2 | The entries of this archive are returned as objects, each accessible by its name. For example, assume that an archive with three entries with the following structure is decompressed: |
```none
+- Archive
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
In this case, you can access the extracted contents of the entries like this:
`payload['summary.pdf']` or `payload.details['result_001.pdf']`
#### Archive and Extractor Example
This example reads in all the files from a folder named input, then creates a compressed archive by
creating an object with the key set to the file name, and the value to the value of the read file.
Next the archive is extracted, then the For-Each scope iterates over each extracted key/value and
writes the file to a new output folder with the key as the new file name, and the value the
corresponding extracted file content.
```xml
```
#### Extractor Errors
If the content is not in the configured format, a `COMPRESSION:INVALID_ARCHIVE` error will be
thrown. For other errors that occur during the compression process, the operation throws a
`COMPRESSION:COULD_NOT_DECOMPRESS` error.
## Common Use cases
### Compress a File
This example reads a file, compresses it, and saves it.
```xml
```
### Decompress a Payload from a Remote Service
This example calls a server that returns and decompresses a Zip file.
```xml
#[payload.body.zipContent]
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/2.0/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.1
---
# Compression Module
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression Module v2.1
Compression Module supports and provides access to the most-used file archiver and compression
formats through a Mule app.
A file archiver is a computer program that combines a number of files together into one archive file
for easier transportation or storage, and most archivers employ data compression in their archive
formats to reduce the size of the final archive. However, not all compression algorithms can archive
multiple files. Some are limited to single-file data compression.
This module compresses and decompresses files for each of the available formats without losing any
of the features that the format associated algorithm provides.
To achieve this capability, the module provides two pairs of operations, one for compressing and
decompressing a single file, another for archiving and extracting a bundle of files. Each of these
operations can be configured with the compression or archiving strategies of your choice.
Release Notes:
[Compression Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-compression)
Exchange: [Compression Module](https://www.mulesoft.com/exchange/org.mule.modules/mule-compression-module/)
## Compress and Decompress a Single File
### Content Compression
Given an input stream, the module compresses the stream and returns a new compressed stream of bits
so it can be stored in a file system or transferred to another system.
#### Compressor Strategies
A Compressor strategy can compress a file or a single-entry archive.
##### GZip Compressor Strategy
When used in an operation, this strategy declares that the content should be compressed with the
`gzip` format.
```xml
```
##### Zip Compressor Strategy
When used in an operation, this strategy declares that the content should be compressed with the
`zip` format.
```xml
```
#### Compress Operation
```xml
#[payload.data] (1)
(2)
```
| 1 | The InputStream to be compressed. Defaults to #[payload]. |
| 2 | Compressor strategy to be used. |
#### Compression Errors
If an error occurs while compressing the content, a `COMPRESSION:COULD_NOT_COMPRESS` error is
thrown.
## Content Decompression
Decompresses single-entry compressed content, which is assumed to be an archive in the specified
compression format.
### Decompressor Strategies
A Decompressor strategy knows how to decompress a file or a single-entry archive.
#### GZip Decompressor Strategy
When used in an operation, this strategy declares that the content should be decompressed with the
`gzip` format.
```xml
```
#### Zip Decompressor Strategy
When used in an operation, this strategy declares that the content should be decompressed with the
`zip` format.
```xml
```
### Decompress Operation
```xml
#[payload] (1)
(2)
```
| 1 | The InputStream to be decompressed. Defaults to #[payload]. |
| 2 | Decompressor strategy to be used. |
#### Decompression Errors
If the given content does not match the format of the configured strategy, a
`COMPRESSION:INVALID_ARCHIVE` error will be thrown.
If the archive to be decompressed has more than one entry, this operation will fail with a
`COMPRESSION:TOO_MANY_ENTRIES` error, because it will not be able to choose only one entry to
return. For these cases, you should use the Extract operation.
## Archive and Extract Multiple Entries
### Archive
Given a Map of ``, the archiving process compresses all the given entries
into a new archive in the configured format.
#### Archiver Strategies
An Archiver strategy is for compressing multiple entries into an archive.
##### Zip Archiver Strategy
When used in an operation, the Zip Archiver strategy declares that the content should be compressed
with the `zip` format.
```xml
```
### Archive Operation
This operation receives a Map that identifies the entries to be compressed and their values. Each
entry passed to this operation is placed inside the compressed archive bearing the name you provide.
```xml
(1)
#[
{
summary.pdf: vars.summary,
'details/result_001.pdf': vars.file1
'details/result_002.pdf': vars.file2
}
]
(2)
```
| 1 | A DataWeave script defining each name of the entry to be compressed as a key and the content of that entry as its value. |
| 2 | The archiver strategy to be used. |
The resulting archive contains _three entries_, one named `summary.pdf` at root level, the others
called `result_001.pdf` and `result_002.pdf`, inside a directory called `details`:
```none
+- content.zip
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
Note that the slash (`/`) in the name of an entry (for example, `details/result_001.pdf`) indicates
directory separation, so all names will be introspected to create directories inside the archive.
> [!NOTE] If you create the input to the Archive operation using a DataWeave expression, the
> DataWeave expression must output an Object, which is used to build the Java Map object. For the
> entire object to be added to the archive, every key must be unique.
#### Archive Errors
If a problem occur while compressing the content, a `COMPRESSION:COULD_NOT_COMPRESS` error will be
thrown.
## Extract
Decompresses content that represents an archive in some compression format.
### Extractor Strategies
An Extractor strategy can decompress an archive with multiple entries that are compressed in a
particular format.
#### Zip Strategy
When used in an operations, this strategy declares that the content should be extracted with the
`zip` format.
```xml
```
### Extract Operation
```xml
#[vars.archive] (1)
(2)
```
| 1 | The compressed content to be extracted. Defaults to #[payload]. |
| 2 | The entries of this archive are returned as objects, each accessible by its name. For example, assume that an archive with three entries with the following structure is decompressed: |
```none
+- Archive
| \- summary.pdf
| \+ details
| \- result_001.pdf
| \- result_002.pdf
```
In this case, you can access the extracted contents of the entries like this:
`payload['summary.pdf']` or `payload.details['result_001.pdf']`
#### Archive and Extractor Example
This example reads in all the files from a folder named input, then creates a compressed archive by
creating an object with the key set to the file name, and the value to the value of the read file.
Next the archive is extracted, then the For-Each scope iterates over each extracted key/value and
writes the file to a new output folder with the key as the new file name, and the value the
corresponding extracted file content.
```xml
```
#### Extractor Errors
If the content is not in the configured format, a `COMPRESSION:INVALID_ARCHIVE` error will be
thrown. For other errors that occur during the compression process, the operation throws a
`COMPRESSION:COULD_NOT_DECOMPRESS` error.
## Common Use cases
### Compress a File
This example reads a file, compresses it, and saves it.
```xml
```
### Decompress a Payload from a Remote Service
This example calls a server that returns and decompresses a Zip file.
```xml
#[payload.body.zipContent]
```
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/2.1/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compression Module
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression module v2.2
Compression module supports and provides access to the most-used file archiver and compression
formats through a Mule app.
A file archiver is a computer program that combines a number of files together into one archive file
for easier transportation or storage, and most archivers employ data compression in their archive
formats to reduce the size of the final archive. However, not all compression algorithms can archive
multiple files. Some are limited to single-file data compression.
This module compresses and decompresses files for each of the available formats without losing any
of the features that the format associated algorithm provides.
To achieve this capability, the module provides the **Compress** and **Decompress** operations,
which enable you to compress and decompress a single file. Additionally, the module provides the
**Archive** and **Extract** operations to archive and extract files. You can configure these
operations with the compression or archiving strategies of your choice.
## Before You Begin
To use this connector, you must be familiar with:
- Anypoint Connectors
- Mule runtime engine (Mule)
- Elements and global elements in a Mule flow
- How to create a Mule app using Anypoint Studio
Before creating an app, you must have access to Anypoint Platform and Anypoint Studio.
## Common Use Cases For the Connector
Common use cases for Compression module include:
- Compress and decompress a file’s payload from a remote service.
- Archive and extrat files from a file folder.
For examples of these use cases, refer to
[Compression Module Examples](https://docs.mulesoft.com/compression-module/latest/compression-module-examples).
## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector
using [Anypoint Studio](https://docs.mulesoft.com/compression-module/latest/compression-module-studio-configuration).
## See Also
- [Archiving and Extracting Files](https://docs.mulesoft.com/compression-module/latest/compression-module-archive-extract)
- [Compressing and Decompressing a Single File](https://docs.mulesoft.com/compression-module/latest/compression-module-compress-decompress)
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compression Module Examples
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression module examples help you compress, decompress, archive and extract files.
- [Compress and Decompress Example](https://docs.mulesoft.com/compression-module/latest/compression-module-compress-decompress-example)
Compress a file using the **Compress** operation and decompress a payload from a remote service
using the **Decompress** operation.
- [Archive and Extract Example](https://docs.mulesoft.com/compression-module/latest/compression-module-archive-extract-example)
Archive and extrat files from a file folder using the **Archive** and **Extract** operations.
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.0
---
# Compression Module Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression Module v2.1
A module which provides functionality for compressing and decompressing data.
Release Notes:
[Compression Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-compression)
## Configurations
---
### Config
Default configuration
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Name | String | The name for this configuration. Connectors reference the configuration with this name. | | x |
## Operations
### Archive
``
Compresses all the given entries into a new file in the configured format.
Each entry passed to this operation is placed inside the compressed archive with the name provided
by the user in the DataWeave script. For example, for this expression:
`{ file: vars.aTxtContent, 'dir/resume.pdf': vars.pdf }`
The resultant archive contains two entries one named "file" at root level and another called
"resume.pdf" inside a directory called "dir"
`- Archive | \- file1 | \ dir1 | \- file2`
In this example, the slash "/" in the name of an entry indicates directory separation, so all names
are introspected to create directories inside the archive.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Entries | | | #[payload] | |
Archiver | | | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior. | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression to evaluate against the operation's output and the outcome of that expression will be stored in the target variable. | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Compress
``
Compresses a given content using the configured format, ZIP or GZIP. If a problem occur while
compressing the content a COULD\_NOT\_COMPRESS error will be thrown.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Content | | | #[payload] | |
Compressor | gzip-compressor zip-compressor
| | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Decompress
``
Decompresses a single entry of compressed content which is assumed to be in an specific format (ZIP
or GZIP). If the content is not in the configured format, an INVALID\_ARCHIVE error is thrown.
Compressed archives can have multiple entries, this operation can handle only single entry archives
because if the archive would contain more than one the operation wouldn't know which should return,
if the content has more than one entry an TOO\_MANY\_ENTRIES error will be thrown. For multiple
entry archives use the \`extract\` operation of this module, which will let you choose only formats
that accept multiple entries.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | | #[payload] | |
Decompressor | gzip-decompressor zip-decompressor
| | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
- COMPRESSION:TOO\_MANY\_ENTRIES
### Extract
``
Decompresses a given content that represent an archive in a compression format.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | | #[payload] | |
Extractor | | | | x |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
## Types
### Repeatable In Memory Stream
| Field | Type | Description | Default Value | Required |
|---|
Initial Buffer Size | | This is the amount of memory to allocate to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. | | |
Buffer Size Increment | | This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower will mean that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full. | | |
Max Buffer Size | | This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit. | | |
Buffer Unit | | The unit in which all these attributes are expressed | | |
### Repeatable File Store Stream
| Field | Type | Description | Default Value | Required |
|---|
Max In Memory Size | | Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk. | | |
Buffer Unit | | The unit in which maxInMemorySize is expressed | | |
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.1
---
# Compression Module Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression Module v2.1
A module which provides functionality for compressing and decompressing data.
Release Notes:
[Compression Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-compression)
## Configurations
---
### Config
Default configuration
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Name | String | The name for this configuration. Connectors reference the configuration with this name. | | x |
## Operations
### Archive
``
Compresses all the given entries into a new file in the configured format.
Each entry passed to this operation is placed inside the compressed archive with the name provided
by the user in the DataWeave script. For example, for this expression:
`{ file: vars.aTxtContent, 'dir/resume.pdf': vars.pdf }`
The resultant archive contains two entries one named "file" at root level and another called
"resume.pdf" inside a directory called "dir"
`- Archive | \- file1 | \ dir1 | \- file2`
In this example, the slash "/" in the name of an entry indicates directory separation, so all names
are introspected to create directories inside the archive.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Entries | | | #[payload] | |
Archiver | | | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior. | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression to evaluate against the operation's output and the outcome of that expression will be stored in the target variable. | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Compress
``
Compresses a given content using the configured format, ZIP or GZIP. If a problem occur while
compressing the content a COULD\_NOT\_COMPRESS error will be thrown.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Content | | | #[payload] | |
Compressor | gzip-compressor zip-compressor
| | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Decompress
``
Decompresses a single entry of compressed content which is assumed to be in an specific format (ZIP
or GZIP). If the content is not in the configured format, an INVALID\_ARCHIVE error is thrown.
Compressed archives can have multiple entries, this operation can handle only single entry archives
because if the archive would contain more than one the operation wouldn't know which should return,
if the content has more than one entry an TOO\_MANY\_ENTRIES error will be thrown. For multiple
entry archives use the \`extract\` operation of this module, which will let you choose only formats
that accept multiple entries.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | | #[payload] | |
Decompressor | gzip-decompressor zip-decompressor
| | | x |
Output Mime Type | | The MIME type of the payload that this operation outputs. | | |
Output Encoding | | The encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
- COMPRESSION:TOO\_MANY\_ENTRIES
### Extract
``
Decompresses a given content that represent an archive in a compression format.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | | #[payload] | |
Extractor | | | | x |
Streaming Strategy | | Configure if repeatable streams should be used and their behavior | | |
Target Variable | | The name of a variable on which the operation's output will be placed | | |
Target Value | | An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable | #[payload] | |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
## Types
### Repeatable In Memory Stream
| Field | Type | Description | Default Value | Required |
|---|
Initial Buffer Size | | This is the amount of memory to allocate to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. | | |
Buffer Size Increment | | This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower will mean that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full. | | |
Max Buffer Size | | This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit. | | |
Buffer Unit | | The unit in which all these attributes are expressed | | |
### Repeatable File Store Stream
| Field | Type | Description | Default Value | Required |
|---|
Max In Memory Size | | Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk. | | |
Buffer Unit | | The unit in which maxInMemorySize is expressed | | |
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compression Module Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Compression Module v2.2
A module which provides functionality for compressing and decompressing data.
Release Notes:
[Compression Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-compression)
## Configurations
---
### Config
Default configuration
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Name | String | The name for this configuration. Connectors reference the configuration with this name. | | x |
## Operations
### Archive
``
Compresses all the given entries into a new file in the configured format.
Each entry passed to this operation is placed inside the compressed archive with the entry name you
provide in the DataWeave script. For example, for the following expression:
`{ file: vars.aTxtContent, 'dir/resume.pdf': vars.pdf }`
The resultant archive contains two entries: `file`, located at the root level, and `resume.pdf`,
located in the `dir` directory.
`- Archive | \- file1 | \ dir1 | \- file2`
In this example, the slash `/` in the name of an entry indicates a directory separation. All names
create directories inside the archive.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Entries | | Entries to add to the archive file. | #[payload]
| |
Archiver | | Archiver strategy that compresses multiple entries into an archive. | | x |
Output Mime Type | | MIME type of the payload that this operation outputs. | | |
Output Encoding | | Encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configures how Mule processes streams. Repeatable streams are the default behavior. | | |
Target Variable | | Name of the variable that stores the operation’s output. | | |
Target Value | | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | #[payload]
| |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Compress
``
Compresses a given content using the configured format `Zip` or `GZip`.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Content | | Content to compress. | #[payload]
| |
Compressor | | Compressor strategy that compresses a file or a single-entry archive. | | x |
Output Mime Type | | MIME type of the payload that this operation outputs. | | |
Output Encoding | | Encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configures how Mule processes streams. Repeatable streams are the default behavior. | | |
Target Variable | | Name of the variable that stores the operation’s output. | | |
Target Value | | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | #[payload]
| |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_COMPRESS
### Decompress
``
Decompresses a single entry of compressed content in the configured format of `Zip` or `GZip`.
Compressed archives can have multiple entries. The **Decompress** operation manages only
single-entry archives because if the archive contains more than one entry, the operation does not
know which entry to return. For multiple entry archives, use this module’s **Extract** operation,
which enables you to select only formats that accept multiple entries.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | Content to decompress. | #[payload]
| |
Decompressor | gzip-decompressor zip-decompressor
| Decompressor strategy that decompress a file or a single-entry archive. | | x |
Output Mime Type | | MIME type of the payload that this operation outputs. | | |
Output Encoding | | Encoding of the payload that this operation outputs. | | |
Streaming Strategy | | Configures how Mule processes streams. Repeatable streams are the default behavior. | | |
Target Variable | | Name of the variable that stores the operation’s output. | | |
Target Value | | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | #[payload]
| |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
- COMPRESSION:TOO\_MANY\_ENTRIES
### Extract
``
Decompresses a given content that represent an archive in a compression format.
#### Parameters
| Name | Type | Description | Default Value | Required |
|---|
Compressed | | Compressed archive content to decompress. | #[payload] | |
Extractor | | Extractor strategy that decompresses an archive with multiple entries that are compressed in a particular format. | | x |
Streaming Strategy | | Configures how Mule processes streams. Repeatable streams are the default behavior. | | |
Target Variable | | Name of the variable that stores the operation’s output. | | |
Target Value | | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | #[payload]
| |
#### Output
#### Throws
- COMPRESSION:COULD\_NOT\_DECOMPRESS
- COMPRESSION:INVALID\_ARCHIVE
## Types
### Repeatable In Memory Stream
| Field | Type | Description | Default Value | Required |
|---|
Initial Buffer Size | | This is the amount of memory to allocate to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. | | |
Buffer Size Increment | | This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower will mean that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full. | | |
Max Buffer Size | | This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit. | | |
Buffer Unit | | The unit in which all these attributes are expressed | | |
### Repeatable File Store Stream
| Field | Type | Description | Default Value | Required |
|---|
Max In Memory Size | | Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk. | | |
Buffer Unit | | The unit in which maxInMemorySize is expressed | | |
### Non-repeatable Stream
Disables the repeatable stream functionality and uses non-repeatable streams to have less
performance overhead, memory use, and cost.
### Zip Compressor
| Field | Type | Description | Default Value | Required |
|---|
Force Zip64 | | Enables you to compress files and byte arrays greater than 4 GB. | false | |
### Zip Archiver
| Field | Type | Description | Default Value | Required |
|---|
Force Zip64 | | Enables you to archive files and byte arrays greater than 4 GB. | false | |
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.1
---
# Compression Module XML and Maven Support
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio.
If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML
editor or from a text editor, you can get access to the connector in your app by adding reference
statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
When you add the connector in Studio, Studio automatically populates the XML code with the
connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file.
## Add a Namespace for the Connector
Paste the following code inside the `` tag of the header of your configuration XML:
```xml
http://www.mulesoft.org/schema/mule/compression
http://www.mulesoft.org/schema/mule/compression/current/mule-compression.xsd
```
This example shows how the namespace statements are placed in the `` XML block:
```xml
```
## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app.
If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to
this connector:
```xml
org.mule.modules
mule-compression-module
x.x.x
mule-plugin
```
Replace `x.x.x` with the version that corresponds to the connector you are using.
To obtain the most up-to-date `pom.xml` file information:
1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/).
2. In Exchange, click **Login** and supply your Anypoint Platform username and password.
3. In Exchange, search for `compression`.
4. Select the connector.
5. Click **Dependency Snippets** near the upper right of the screen.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Compression Module XML and Maven Support
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio.
If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML
editor or from a text editor, you can get access to the connector in your app by adding reference
statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
When you add the connector in Studio, Studio automatically populates the XML code with the
connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file.
## Add a Namespace for the Connector
Paste the following code inside the `` tag of the header of your configuration XML:
```xml
http://www.mulesoft.org/schema/mule/compression
http://www.mulesoft.org/schema/mule/compression/current/mule-compression.xsd
```
This example shows how the namespace statements are placed in the `` XML block:
```xml
```
## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app.
If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to
this connector:
```xml
org.mule.modules
mule-compression-module
x.x.x
mule-plugin
```
Replace `x.x.x` with the version that corresponds to the connector you are using.
To obtain the most up-to-date `pom.xml` file information:
1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/).
2. In Exchange, click **Login** and supply your Anypoint Platform username and password.
3. In Exchange, search for `compression`.
4. Select the connector.
5. Click **Dependency Snippets** near the upper right of the screen.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Salesforce Help](https://help.salesforce.com)
---
product: Compression Module
version: 2.1
---
# Troubleshooting Compression Module
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
To troubleshoot Compression module, become familiar with the information about enabling verbose
logging and interpreting commonly thrown messages.
## Enable Verbose Logging
To get a better understanding of why an application’s interaction with the Compression module is
failing, temporarily enable verbose logging for the module.
Remember to always disable the enhanced verbosity after troubleshooting, because it affects your
Mule application performance.
To enable verbose logging in the configuration file:
1. Access Anypoint Studio and navigate to the **Package Explorer** view.
2. Open your application’s project name.
3. Open the `src/main/resources` path folder.
4. Open the `log4j2.xml` file inside the folder.
5. Add an `` tag inside the `` tag:
```xml
...
...
```
6. Save your application changes.
7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule
Application**.
## Understand Common Throws
Here is a list of common throw messages and how to interpret them:
- COMPRESSION:COULD\_NOT\_COMPRESS
An error occurred while trying to compress content.
- COMPRESSION:COULD\_NOT\_DECOMPRESS
An error occurred while trying to decompress content.
- COMPRESSION:INVALID\_ARCHIVE
The content to decompress is an invalid archive.
- COMPRESSION:TOO\_MANY\_ENTRIES
When an archive with multiple entries passes to the **Decompress** operation, the module is unable
to choose only one entry.
## See Also
- [Salesforce Help](https://help.salesforce.com)
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/2.1/compression-documentation)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Troubleshooting Compression Module
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
To troubleshoot Compression module, become familiar with the information about enabling verbose
logging and interpreting commonly thrown messages.
## Enable Verbose Logging
To get a better understanding of why an application’s interaction with the Compression module is
failing, temporarily enable verbose logging for the module.
Remember to always disable the enhanced verbosity after troubleshooting, because it affects your
Mule application performance.
To enable verbose logging in the configuration file:
1. Access Anypoint Studio and navigate to the **Package Explorer** view.
2. Open your application’s project name.
3. Open the `src/main/resources` path folder.
4. Open the `log4j2.xml` file inside the folder.
5. Add an `` tag inside the `` tag:
```xml
...
...
```
6. Save your application changes.
7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule
Application**.
## Understand Common Throws
Here is a list of common throw messages and how to interpret them:
- COMPRESSION:COULD\_NOT\_COMPRESS
An error occurred while trying to compress content.
- COMPRESSION:COULD\_NOT\_DECOMPRESS
An error occurred while trying to decompress content.
- COMPRESSION:INVALID\_ARCHIVE
The content to decompress is an invalid archive.
- COMPRESSION:TOO\_MANY\_ENTRIES
When an archive with multiple entries passes to the **Decompress** operation, the module is unable
to choose only one entry.
## See Also
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)
- [Known Issues](https://help.salesforce.com/s/issues)
---
product: Compression Module
version: 2.2
is-latest-version: true
---
# Using Anypoint Studio to Configure Compression Module 2.2
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and
configuration files.
To add and configure a connector in Studio:
1. [Create a Mule project](#create-mule-project).
2. [Add the connector to your Mule project](#add-connector-to-project).
3. [Configure a source for the connector’s flow](#configure-source).
4. [Add a connector operation to the flow](#add-connector-operation).
When you run the connector, you can view the app log to check for problems in real time, as
described in [View the App Log](#view-app-log).
If you are new to configuring connectors in Studio, see
[Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio).
If, after reading this topic, you need additional information about the connector fields, see the
[Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation).
## Create a Mule Project
In Studio, create a new Mule project in which to add and configure the connector:
1. In Studio, select **File > New > Mule Project**.
2. Enter a name for your Mule project and click **Finish**.
## Add the Connector to Your Mule Project
Add Compression module to your Mule project to automatically populate the XML code with the
connector’s namespace and schema location and add the required dependencies to the project’s
`pom.xml` file:
1. In **Mule Palette**, click **(X) Search in Exchange**.
2. In **Add Dependencies to Project**, type `connector-template-files` in the search field.
3. Click Compression Module in **Available modules**.
4. Click **Add**.
5. Click **Finish**.
Adding a connector to a Mule project in Studio does not make that connector available to other
projects in your Studio workspace.
## Configure a Source
A source initiates a flow when a specified condition is met. You can configure one of these sources
to use with Compression module:
- HTTP Listener
Initiates a flow each time it receives a request on the configured host and port
- Scheduler
Initiates a flow when a time-based condition is met
For example, to configure an HTTP Listener source, follow these steps:
1. In **Mule Palette**, select **HTTP > Listener**.
2. Drag **Listener** to the Studio canvas.
3. On the **Listener** configuration screen, optionally change the value of the **Display Name**
field.
4. Specify a value for the **Path** field.
5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global
element that can be used by all instances of the HTTP Listener source in the app.
6. On the **General** tab, specify connection information for the connector.
7. On the **TLS** tab, optionally specify the TLS information for the connector.
8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection
strategy.
9. Click **Test Connection** to confirm that Mule can connect with the specified server.
10. Click **OK**.
## Add a Connector Operation to the Flow
When you add a connector operation to your flow, you are specifying an action for that connector to
perform.
To add an operation for Compression module, follow these steps:
1. In **Mule Palette**, select **Compression** and then select the desired operation.
2. Drag the operation onto the Studio canvas, next to the input source.

## View the App Log
To check for problems, you can view the app log as follows:
- If you’re running the app from Anypoint Platform, the app log output goes to the Anypoint Studio
console window.
- If you’re running the app using Mule from the command line, the app log output goes to your
operating system console.
Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also access the
app log in the default location `MULE_HOME/logs/.log`. You can configure the location of
the log path in the app log file `log4j2.xml`.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)
- [Compression Module Reference](https://docs.mulesoft.com/compression-module/latest/compression-documentation)
- [Salesforce Help](https://help.salesforce.com)