Author: buildbot
Date: Mon Aug 12 14:20:32 2013
New Revision: 874335
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/stream-caching.html
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/stream-caching.html
==============================================================================
--- websites/production/camel/content/stream-caching.html (original)
+++ websites/production/camel/content/stream-caching.html Mon Aug 12 14:20:32
2013
@@ -262,7 +262,7 @@ The old kind of configuration using prop
<p>The strategy has the following options:</p>
<div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Option </th><th colspan="1" rowspan="1"
class="confluenceTh"> Default </th><th colspan="1" rowspan="1"
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>spoolDirectory</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>${java.io.tmpdir}camel-tmp-#uuid#</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> Base directory where temporary
files for spooled streams should be stored. This option supports naming
patterns as documented below. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>spoolChiper</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> If set, the temporary files are encrypted using the
specified cipher transformation (i.e., a valid stream or 8-bit cipher name such
as "RC4", "AES/CTR/NoPadding". An empty name "" is tr
eated as null).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>spoolThreshold</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>128kb</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Size in
bytes when the stream should be spooled to disk instead of keeping in memory.
Use a value of 0 or negative to disable it all together so streams is always
kept in memory regardless of their size. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>spoolHeapMemoryWatermarkThreshold</tt>
</td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> A percentage (1 to 99) of current
used heap memory to use as threshold for spooling streams to disk. The upper
bounds is based on heap committed (guaranteed memory the JVM can claim). This
can be used to spool to disk when running low on memory. </td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>anySpoolRules</tt> </td
><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td
>colspan="1" rowspan="1" class="confluenceTd"> Whether any or all
><tt>SpoolRule}}s must return {{true</tt> to determine if the stream should be
>spooled or not. This can be used as applying AND/OR binary logic to all the
>rules. By default its AND based. </td></tr><tr><td colspan="1" rowspan="1"
>class="confluenceTd"> <tt>bufferSize</tt> </td><td colspan="1" rowspan="1"
>class="confluenceTd"> <tt>4096</tt> </td><td colspan="1" rowspan="1"
>class="confluenceTd"> Initial size if in-memory created stream buffers.
></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
><tt>removeSpoolDirectoryWhenStopping</tt> </td><td colspan="1" rowspan="1"
>class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1"
>class="confluenceTd"> Whether to remove the spool directory when stopping <a
>shape="rect" href="camelcontext.html" title="CamelContext">CamelContext</a>.
></td></tr><tr><td colspan="1" rowspan="1" class="c
onfluenceTd"> <tt>statisticsEnabled</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Whether utilization statistics is enabled. By enabling
this you can see these statics for example with JMX. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Option </th><th colspan="1" rowspan="1"
class="confluenceTh"> Default </th><th colspan="1" rowspan="1"
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>spoolDirectory</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>${java.io.tmpdir}camel-tmp-#uuid#</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> Base directory where temporary
files for spooled streams should be stored. This option supports naming
patterns as documented below. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>spoolChiper</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> If set, the temporary files are encrypted using the
specified cipher transformation (i.e., a valid stream or 8-bit cipher name such
as "RC4", "AES/CTR/NoPadding". An empty name "" is tr
eated as null).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>spoolThreshold</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>128kb</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Size in
bytes when the stream should be spooled to disk instead of keeping in memory.
Use a value of 0 or negative to disable it all together so streams is always
kept in memory regardless of their size. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>spoolUsedHeapMemoryThreshold</tt>
</td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> A percentage (1 to 99) of current
used heap memory to use as threshold for spooling streams to disk. The upper
bounds is based on heap committed (guaranteed memory the JVM can claim). This
can be used to spool to disk when running low on memory. </td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>spoolUsedHeapMemoryLimit</tt
> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Max</tt> </td><td
> colspan="1" rowspan="1" class="confluenceTd"> If
> <tt>spoolUsedHeapMemoryThreshold</tt> is in use, then whether the used heap
> memory upper limit is either <tt>Max</tt> or <tt>Committed</tt>.
> </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
> <tt>anySpoolRules</tt> </td><td colspan="1" rowspan="1"
> class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
> class="confluenceTd"> Whether any or all <tt>SpoolRule}}s must return
> {{true</tt> to determine if the stream should be spooled or not. This can be
> used as applying AND/OR binary logic to all the rules. By default its AND
> based. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
> <tt>bufferSize</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
> <tt>4096</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Initial
> size if in-memory created stream buffers. </td></tr><tr><td colspan="1"
> rowspan="1" class="con
fluenceTd"> <tt>removeSpoolDirectoryWhenStopping</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> Whether to remove the spool directory when
stopping <a shape="rect" href="camelcontext.html"
title="CamelContext">CamelContext</a>. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>statisticsEnabled</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> Whether utilization statistics is
enabled. By enabling this you can see these statics for example with JMX.
</td></tr></tbody></table>
</div>
@@ -344,35 +344,43 @@ context.setStreamCaching(true);
</div></div>
-<h4><a shape="rect"
name="Streamcaching-UsingspoolHeapMemoryWatermarkThreshold"></a>Using
spoolHeapMemoryWatermarkThreshold</h4>
+<h4><a shape="rect"
name="Streamcaching-UsingspoolUsedHeapMemoryThreshold"></a>Using
spoolUsedHeapMemoryThreshold</h4>
-<p>By default stream caching will spool only big payloads (128kb or bigger) to
disk. However you can also set the spoolHeapMemoryWatermarkThreshold option
which is a percentage of used heap memory. This can be used to also spool to
disk when running low on memory.</p>
+<p>By default stream caching will spool only big payloads (128kb or bigger) to
disk. However you can also set the spoolUsedHeapMemoryThreshold option which is
a percentage of used heap memory. This can be used to also spool to disk when
running low on memory.</p>
<p>For example with:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
- <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolHeapMemoryWatermarkThreshold="70"/>
+ <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolUsedHeapMemoryThreshold="70"/>
]]></script>
</div></div>
-<p>Then notice that as spoolThreshold is default enabled with 128kb, then we
have both thresholds in use (spoolThreads and
spoolHeapMemoryWatermarkThreshold). And in this example then we only spool to
disk if payload is > 128kb and that used heap memory is > 70%. The reason
is that we have the option <tt>anySpoolRules</tt> as default <tt>false</tt>.
That means both rules must be <tt>true</tt> (eg AND). </p>
+<p>Then notice that as spoolThreshold is default enabled with 128kb, then we
have both thresholds in use (spoolThreshold and spoolUsedHeapMemoryThreshold).
And in this example then we only spool to disk if payload is > 128kb and
that used heap memory is > 70%. The reason is that we have the option
<tt>anySpoolRules</tt> as default <tt>false</tt>. That means both rules must be
<tt>true</tt> (eg AND). </p>
<p>If we want to spool to disk if either of the rules (eg OR), then we can
do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
- <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolHeapMemoryWatermarkThreshold="70" anySpoolRules="true"/>
+ <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolUsedHeapMemoryThreshold="70" anySpoolRules="true"/>
]]></script>
</div></div>
<p>If we only want to spool to disk if we run low on memory then we can
set:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
- <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolThreshold="-1" spoolHeapMemoryWatermarkThreshold="70"/>
+ <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolThreshold="-1" spoolUsedHeapMemoryThreshold="70"/>
]]></script>
</div></div>
<p>... then we do not use the spoolThreshold rule, and only the heap memory
based is in use.</p>
+<p>By default the upper limit of the used heap memory is based on the maximum
heap size. Though you can also configure to use the committed heap size as the
upper limit, this is done using the <tt>spoolUsedHeapMemoryThreshold</tt>
option as shown below:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
+ <streamCaching id="myCacheConfig" spoolDirectory="/tmp/cachedir"
spoolUsedHeapMemoryThreshold="70" spoolUsedHeapMemoryLimit="Committed"/>
+]]></script>
+</div></div>
+
+
<h4><a shape="rect"
name="Streamcaching-UsingcustomSpoolRuleimplementations"></a>Using custom
SpoolRule implementations</h4>
<p>You can implement your custom rules to determine if the stream should be
spooled to disk. This can be done by implementing the interface
<tt>org.apache.camel.spi.StreamCachingStrategy.SpoolRule</tt> which has a
single method:</p>