[CONF] Apache Camel: GZip data format (page created)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[CONF] Apache Camel: GZip data format (page created)

Dhiraj Bokde (Confluence)

GZip data format has been created by Roman Kalukiewicz (Mar 20, 2009).

Content:

The GZip Data Format is a message compression and de-compression format. It uses the same deflate algorithm that is used in Zip Data Format, although some additional headers are provided. This format is produced by popular gzip/gunzip tool. Messages marshalled using GZip compression can be unmarshalled using GZip decompression just prior to being consumed at the endpoint. The compression capability is quite useful when you deal with large XML and Text based payloads or when you read messages previously comressed using gzip tool.

Options

There are no options provided for this data format.

Marshal

In this example we marshal a regular text/XML payload to a compressed payload employing gzip compression format and send it an ActiveMQ queue called MY_QUEUE.

from("direct:start").marshal().gzip().to("activemq:queue:MY_QUEUE");

Unmarshal

In this example we unmarshal a gzipped payload from an ActiveMQ queue called MY_QUEUE to its original format, and forward it for processing to the UnGZippedMessageProcessor.

from("activemq:queue:MY_QUEUE").unmarshal().zip().process(new UnGZippedMessageProcessor());

Dependencies

This data format is provided in camel-core so no additional dependencies is needed.