You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2013/06/21 12:18:35 UTC
svn commit: r866773 - in /websites/production/camel/content:
2013/04/28/apache-camel-297-released.html cache/main.pageCache index.html
news.html stream-caching.html
Author: buildbot
Date: Fri Jun 21 10:18:34 2013
New Revision: 866773
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/2013/04/28/apache-camel-297-released.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/index.html
websites/production/camel/content/news.html
websites/production/camel/content/stream-caching.html
Modified: websites/production/camel/content/2013/04/28/apache-camel-297-released.html
==============================================================================
--- websites/production/camel/content/2013/04/28/apache-camel-297-released.html (original)
+++ websites/production/camel/content/2013/04/28/apache-camel-297-released.html Fri Jun 21 10:18:34 2013
@@ -35,6 +35,8 @@
</style>
<![endif]-->
+
+
<title>
Apache Camel: Apache Camel 2.9.7 Released
</title>
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/index.html
==============================================================================
--- websites/production/camel/content/index.html (original)
+++ websites/production/camel/content/index.html Fri Jun 21 10:18:34 2013
@@ -35,6 +35,8 @@
</style>
<![endif]-->
+
+
<title>
Apache Camel: Index
</title>
Modified: websites/production/camel/content/news.html
==============================================================================
--- websites/production/camel/content/news.html (original)
+++ websites/production/camel/content/news.html Fri Jun 21 10:18:34 2013
@@ -35,6 +35,8 @@
</style>
<![endif]-->
+
+
<title>
Apache Camel: News
</title>
Modified: websites/production/camel/content/stream-caching.html
==============================================================================
--- websites/production/camel/content/stream-caching.html (original)
+++ websites/production/camel/content/stream-caching.html Fri Jun 21 10:18:34 2013
@@ -35,6 +35,8 @@
</style>
<![endif]-->
+
+
<title>
Apache Camel: Stream caching
</title>
@@ -192,27 +194,55 @@ from(<span class="code-quote">"jbi:servi
</div>
-<p>You set these properties on the CamelContext as shown below:</p>
+<p>You set these properties on the CamelContext as shown below, where we use a 1mb threshold to spool to disk for messages bigger than 1mb:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
context.getProperties().put(CachedOutputStream.TEMP_DIR, <span class="code-quote">"/tmp/cachedir"</span>);
-context.getProperties().put(CachedOutputStream.THRESHOLD, <span class="code-quote">"1024"</span>);
-context.getProperties().put(CachedOutputStream.BUFFER_SIZE, <span class="code-quote">"4096"</span>);
+context.getProperties().put(CachedOutputStream.THRESHOLD, <span class="code-quote">"1048576"</span>);
+context.getProperties().put(CachedOutputStream.BUFFER_SIZE, <span class="code-quote">"131072"</span>);
<span class="code-comment">// to enable encryption using RC4
</span><span class="code-comment">// context.getProperties().put(CachedOutputStream.CIPHER_TRANSFORMATION, <span class="code-quote">"RC4"</span>);</span>
</pre>
</div></div>
+<p>And in XML you do</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+<span class="code-tag"><camelContext xmlns=<span class="code-quote">"http://camel.apache.org/schema/blueprint"</span>></span>
+
+ <span class="code-tag"><span class="code-comment"><!-- disable stream caching spool to disk --></span></span>
+ <span class="code-tag"><properties></span>
+ <span class="code-tag"><property key=<span class="code-quote">"CamelCachedOutputStreamOutputDirectory"</span> value=<span class="code-quote">"/tmp/cachedir"</span>/></span>
+ <span class="code-tag"><property key=<span class="code-quote">"CamelCachedOutputStreamThreshold"</span> value=<span class="code-quote">"1048576"</span>/></span>
+ <span class="code-tag"><property key=<span class="code-quote">"CamelCachedOutputStreamBufferSize"</span> value=<span class="code-quote">"131072"</span>/></span>
+ <span class="code-tag"></properties></span>
+</pre>
+</div></div>
+
+
<h4><a shape="rect" name="Streamcaching-Disablingspoolingtodisk"></a>Disabling spooling to disk</h4>
<p>You can disable spooling to disk by setting a threshold of 0 or a negative value.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-comment">// disable spooling to disk
-</span>context.getProperties().put(CachedOutputStream.THRESHOLD, <span class="code-quote">"0"</span>);
+</span>context.getProperties().put(CachedOutputStream.THRESHOLD, <span class="code-quote">"-1"</span>);
+</pre>
+</div></div>
+
+<p>And in XML you do</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">
+<span class="code-tag"><camelContext xmlns=<span class="code-quote">"http://camel.apache.org/schema/blueprint"</span>></span>
+
+ <span class="code-tag"><span class="code-comment"><!-- disable stream caching spool to disk --></span></span>
+ <span class="code-tag"><properties></span>
+ <span class="code-tag"><property key=<span class="code-quote">"CamelCachedOutputStreamThreshold"</span> value=<span class="code-quote">"-1"</span>/></span>
+ <span class="code-tag"></properties></span>
</pre>
</div></div>
+
<h3><a shape="rect" name="Streamcaching-Howitworks%3F"></a>How it works?</h3>
<p>In order to determine if a type requires caching, we leverage the <a shape="rect" href="type-converter.html" title="Type Converter">type converter </a> feature. Any type that requires stream caching can be converted into an <b><tt>org.apache.camel.StreamCache</tt></b> instance.</p></div>
</td>