gzip compress and uncompress transformer with mulesoft
TRANSCRIPT
Gzip Compress and Uncompress Transformer With Mulesoft
Gzip compress is used to compresses the byte array using gzip where as Gzip un-compress is used
to un-compresses the byte array using gzip.
There is often requirement that we need to compress the message payload and un-compress the
message payload at the end of the operations. Mulesoft provided out-of-box Gzip compress and un-
compress to achieve this.
Compress Message Payload Using Gzip
Place the file connector into Message Source in the flow and configure it.
Now, you need to convert message into byte array. So, place the String To Byte Array
transformer in message processor region after inbound file connector.
Place the Gzip compress transformer after String To Byte Array transformer.
Compress Message Payload Using Gzip
Finally, place the outbound file connector at the end of message processor and it will be used to
store the compress file.
Testing ApplicationDrop the plain file to folder location that you have specified in inbound file connector and outbound
compress file can be seen at folder location that you have specified for outbound file connector.
Uncompress Message Payload Using Gzip
Now for uncompressing the payload you need to use Gzip un-compress instead of Gzip compress.
Testing ApplicationDrop the compressed file to folder location that you have specified in inbound file connector and
outbound un-compress file can be seen at folder location that you have specified for outbound file
connector.