Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using StreamCachingStrategy in XML

And in XML you do:

Code Block
xml
xml

  <camelContext streamCache="true" xmlns="http://camel.apache.org/schema/blueprint">

    <streamCaching id="myCacheConfig" bufferSize="16384" spoolDirectory="/tmp/cachedir" spoolThreshold="65536"/>

    <route>
      <from uri="direct:c"/>
      <to uri="mock:c"/>
    </route>

  </camelContext>

You can also define a <bean> instead of using the <streamCaching> tag:

And in XML you do

Code Block
xml
xml
<!-- define a bean of type StreamCachingStrategy which CamelContext will automatic use -->
<bean id="streamStrategy" class="org.apache.camel.impl.DefaultStreamCachingStrategy">
  <property name="spoolDirectory" value="/tmp/cachedir"/>
  <property name="spoolThreshold" value="65536"/>
  <property name="bufferSize" value="16384"/>
</bean>

<!-- remember to enable stream caching -->
<camelContext streamCaching="true" xmlns="http://camel.apache.org/schema/spring">

...