Compression
The Compression component is used to compress the incoming data and send it forward. This component can compress file or directory and store it to target directory. It makes use of the APIs available in the java.util.zip package. The component compresses the text and attachment contained in the incoming document.
Configuration and Testing
Interaction Configurations
Figure 1: Interaction Configurations
Attributes
Compress File?
Enable this property to compress the input file or directory.
After this property is enabled, below attributes (which appear when Compress File attribute is selected) need to be specified.
Figure 2: Attributes supporting Compress file property
Source File Directory
The directory from where the component picks the files to be compressed. Provide the absolute path here.
Source File Name
The name of the file which needs to be compressed. Provide the full file name with extension .zip, for example, inputfile.zip
This field should be left empty if Source Directory has to be compressed.
Target File Directory
The directory to where the component sends the compressed file/s, that is, where the files get stored. Provide absolute path here.
Target File Name
The name to be used while saving the compressed file to the directory. Provide the full file name with extension .zip, for example, outputfile.zip.
Action if same file exist
If the file with same name exists in the target folder, choose the action to be taken from the below options:
- Overwrite: Overwrites the existing file and hence the old file gets replaced with the new one.
- Rename: Renames the file with "filename + MMddyyHHmmss + counter(optional)".
Figure 3: Options of Actions in case file name matches
Monitoring Configuration
Please refer to the Monitoring Configuration section in Common Configurations page.
Expert Properties
Enable the Show Expert Properties checkbox to make the properties visible.
Expert properties are meant for advanced users; please use with caution.
Figure 4: Compression CPS with Expert Properties enabled and highlighted
Process Message Based on Property
The property helps components to skip certain messages from processing.
Refer to the Process Message Based On a Property section under the Common Configurations page.
Cleanup resources (excluding connection) after each document
This closes all the resources except for the connection after every request. If the less processing time is more important than the less memory usage, then it is recommended to disable this property and vice versa.
For more details, refer to the respective section under in the Common Configurations page.
Target Namespace
Target Namespace for the request and response XML messages.
For more details, refer to the respective section under in the Common Configurations page.
Scheduler Configurations
Click next to set Scheduler Configurations.
Please refer the respective section in Common Configurations page.
Transport Configurations
Click next to set Transport Configurations.
Please refer the respective section in Common Configurations page.
Transport Configurations panel will be available only if scheduling is enabled in Scheduler Configurations panel.
Error Handling
Please refer the sections Request Processing Error and Invalid Request Error in the Error Handling section of Common Configurations page for details.
Testing
Sample Input and Output
The configuration can be tested by clicking the Test button in the Interaction Configuration panel.
Type "Hello World!" in the Input Message editor and click Execute.
Figure 5: Sample Input Message
Response generated appears in the Output Message tab.
Figure 6: Response Generated
Functional Demonstration
Scenario
Compress the incoming data.
Configure the Compression adapter and use Feeder and Display component to send sample input and to check the response respectively. Bytes data is displayed in the Display component.
Figure 7: Sample Event Process
Sample Input
Run the Event Process and click Send in the Feeder window.
Figure 8: Sample Input
Output
"Input Text" in the feeder is the default message present in the Feeder window.
Figure 9: Output in the Display window
Useful Tips
Currently, the component’s compression algorithm is not configurable.