gzip compress and uncompress transformer with mulesoft

11
GZIP COMPRESS AND UNCOMPRESS TRANSFORMER WITH MULESOFT

Upload: jitendra-bafna

Post on 11-Apr-2017

29 views

Category:

Software


0 download

TRANSCRIPT

GZIP COMPRESS AND UNCOMPRESS

TRANSFORMER WITH MULESOFT

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

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.

Testing ApplicationGzip compress transformer reduce the size of original file by almost 5 times.

Uncompress Message Payload Using Gzip

Now for uncompressing the payload you need to use Gzip un-compress instead of Gzip compress.

Uncompress Message Payload Using Gzip

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.

THANK YOU.