blob: 092b84b4b44ce54aa2ca2aff9656d2d37911abb2 [file] [log] [blame]
<div class="docbook"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">9.9.&#160;Message Compression</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="Java-Broker-Runtime-Background-Recovery.html">Prev</a>&#160;</td><th align="center" width="60%">Chapter&#160;9.&#160;Runtime</th><td align="right" width="20%">&#160;<a accesskey="n" href="Java-Broker-Runtime-Connection-Limit.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Java-Broker-Runtime-Message-Compression"></a>9.9.&#160;Message Compression</h2></div></div></div><p>The Apache Qpid Broker-J supports<a class="footnote" href="#ftn.d0e6216" id="d0e6216"><sup class="footnote">[10]</sup></a> message compression. This feature works in co-operation with Qpid
Clients implementing the same feature.</p><p>Once the feature is enabled (using Broker context variable
<span class="emphasis"><em>broker.messageCompressionEnabled</em></span>), the Broker will advertise support for the
message compression feature to the client at connection time. This allows clients to opt to turn
on message compression, allowing message payload sizes to be reduced.</p><p>If the Broker has connections from clients who have message compression enabled and others who
do not, it will internally, on-the-fly, decompress compressed messages when sending to clients
without support and conversely, compress uncomressed messages when sending to clients who do.</p><p>The Broker has a threshold below which it will not consider compressing a message, this is
controlled by Broker content variable
(<code class="literal">connection.messageCompressionThresholdSize</code>) and expresses a size in bytes.</p><p>This feature <span class="emphasis"><em>may</em></span> have a beneficial effect on performance by:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Reducing the number of bytes transmitted over the wire, both between Client and Broker, and
in the HA case, Broker to Broker, for replication purposes.</p></li><li class="listitem"><p>Reducing storage space when data is at rest within the Broker, both on disk and in
memory.</p></li></ul></div><p>Of course, compression and decompression is computationally expensive. Turning on the feature
may have a negative impact on CPU utilization on Broker and/or Client. Also for small messages
payloads, message compression may increase the message size. It is recommended to test the feature
with representative data.</p><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div class="footnote" id="ftn.d0e6216"><p><a class="para" href="#d0e6216"><sup class="para">[10] </sup></a>Message compression is not yet supported for the 1.0
protocol.</p></div></div></div><div class="navfooter"><hr /><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="Java-Broker-Runtime-Background-Recovery.html">Prev</a>&#160;</td><td align="center" width="20%"><a accesskey="u" href="Java-Broker-Runtime.html">Up</a></td><td align="right" width="40%">&#160;<a accesskey="n" href="Java-Broker-Runtime-Connection-Limit.html">Next</a></td></tr><tr><td align="left" valign="top" width="40%">9.8.&#160;Background Recovery&#160;</td><td align="center" width="20%"><a accesskey="h" href="Apache-Qpid-Broker-J-Book.html">Home</a></td><td align="right" valign="top" width="40%">&#160;9.10.&#160;Connection Limits</td></tr></table></div></div>