compress

Processor for compressing the incoming payload (i.e., by creating a zip archive).

Properties

Name Summary

format

Compression format to use (e.g., zip).

compressionStrategy

Configuration of the compression algorithm, typically used to focus on speed or size. Defaults to CompressionStrategy.Default.

name

Optional, descriptive name for the processor.

id

Required identifier of the processor, unique across all processors within the flow. Must be between 3 and 30 characters long; contain only lower and uppercase alphabetical characters (a-z and A-Z), numbers, dashes ("-"), and underscores ("_"); and start with an alphabetical character. In other words, it adheres to the regex pattern [a-zA-Z][a-zA-Z0-9_-]{2,29}.

exchangeProperties

Optional set of custom properties in a simple jdk-format, that are added to the message exchange properties before processing the incoming payload. Any existing properties with the same name will be replaced by properties defined here.

retainPayloadOnFailure

Whether the incoming payload is available for error processing on failure. Defaults to false.

Sub-builders

Name Summary

messageLoggingStrategy

Strategy for describing how a processor’s message is logged on the server.

payloadArchivingStrategy

Strategy for archiving payloads.

inboundTransformationStrategy

Strategy that customizes the conversion of an incoming payload by a processor (e.g., string to object). Should be used when the processor’s default conversion logic cannot be used.

Details

Formats

The compress processor transforms a payload to a compressed byte array using the given compression format. The following formats are supported, with their corresponding suffixes:

Format Suffix

zip

.zip

zstd

.zstd

gzip

.gz

zstd has better compression and is generally recommended for internal usage. Use zip when it is required externally.

If the compressed entity needs to be named (i.e., for zip file entries), you can use the fileName exchange property (available as the constant FILE_NAME) to name it. Otherwise, the default naming strategy is <timestamp>-<messageId> with no suffix. If a file name is defined, the processor will append the appropriate suffix to it.

See the decompress processor for information on decompressing these formats.

Compression Strategy

For zip compression, it’s possible to provide a compression strategy to give the processor a hint on how to configure the compressor. Aside from Default, the other available options are BestSize and BestSpeed. Note that zstd and gzip will ignore any provided compression strategy.