Class CamelStreamCachingStrategyDefinition

java.lang.Object
org.apache.camel.model.IdentifiedType
org.apache.camel.core.xml.CamelStreamCachingStrategyDefinition

@Metadata(label="spring,configuration") public class CamelStreamCachingStrategyDefinition extends org.apache.camel.model.IdentifiedType
Stream caching configuration.
  • Constructor Details

    • CamelStreamCachingStrategyDefinition

      public CamelStreamCachingStrategyDefinition()
  • Method Details

    • getEnabled

      public String getEnabled()
    • setEnabled

      public void setEnabled(String enabled)
      Sets whether stream caching is enabled or not. While stream types (like StreamSource, InputStream and Reader) are commonly used in messaging for performance reasons, they also have an important drawback: they can only be read once. In order to be able to work with message content multiple times, the stream needs to be cached. Streams are cached in memory only (by default). If streamCachingSpoolEnabled=true, then, for large stream messages (over 128 KB by default) will be cached in a temporary file instead, and Camel will handle deleting the temporary file once the cached stream is no longer necessary. Default is true.
    • getAllowClasses

      public String getAllowClasses()
    • setAllowClasses

      public void setAllowClasses(String allowClasses)
      To filter stream caching of a given set of allowed/denied classes. By default, all classes that are InputStream is allowed. Multiple class names can be separated by comma.
    • getDenyClasses

      public String getDenyClasses()
    • setDenyClasses

      public void setDenyClasses(String denyClasses)
      To filter stream caching of a given set of allowed/denied classes. By default, all classes that are InputStream is allowed. Multiple class names can be separated by comma.
    • getSpoolEnabled

      public String getSpoolEnabled()
    • setSpoolEnabled

      public void setSpoolEnabled(String spoolEnabled)
      To enable stream caching spooling to disk. This means, for large stream messages (over 128 KB by default) will be cached in a temporary file instead, and Camel will handle deleting the temporary file once the cached stream is no longer necessary. Default is false.
    • getSpoolDirectory

      public String getSpoolDirectory()
    • setSpoolDirectory

      public void setSpoolDirectory(String spoolDirectory)
      Sets the spool (temporary) directory to use for overflow and spooling to disk.

      If no spool directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir directory.

    • getSpoolCipher

      public String getSpoolCipher()
    • setSpoolCipher

      public void setSpoolCipher(String spoolCipher)
      Sets a cipher name to use when spooling to disk to write with encryption.

      By default the data is not encrypted.

    • getSpoolThreshold

      public String getSpoolThreshold()
    • setSpoolThreshold

      public void setSpoolThreshold(String spoolThreshold)
      Threshold in bytes when overflow to disk is activated.

      The default threshold is StreamCache.DEFAULT_SPOOL_THRESHOLD bytes (eg 128kb). Use -1 to disable overflow to disk.

    • getSpoolUsedHeapMemoryThreshold

      public String getSpoolUsedHeapMemoryThreshold()
    • setSpoolUsedHeapMemoryThreshold

      public void setSpoolUsedHeapMemoryThreshold(String spoolUsedHeapMemoryThreshold)
      Sets a percentage (1-99) of used heap memory threshold to activate spooling to disk.
    • getSpoolUsedHeapMemoryLimit

      public String getSpoolUsedHeapMemoryLimit()
    • setSpoolUsedHeapMemoryLimit

      public void setSpoolUsedHeapMemoryLimit(String spoolUsedHeapMemoryLimit)
      Sets what the upper bounds should be when spoolUsedHeapMemoryThreshold is in use.
    • getSpoolRules

      public String getSpoolRules()
    • setSpoolRules

      public void setSpoolRules(String spoolRules)
      Reference to one or more custom StreamCachingStrategy.SpoolRule to use. Multiple rules can be separated by comma.
    • getBufferSize

      public String getBufferSize()
    • setBufferSize

      public void setBufferSize(String bufferSize)
      Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.

      The default size is IOHelper.DEFAULT_BUFFER_SIZE

    • getRemoveSpoolDirectoryWhenStopping

      public String getRemoveSpoolDirectoryWhenStopping()
    • setRemoveSpoolDirectoryWhenStopping

      public void setRemoveSpoolDirectoryWhenStopping(String removeSpoolDirectoryWhenStopping)
      Whether to remove the temporary directory when stopping.

      This option is default true

    • getStatisticsEnabled

      public String getStatisticsEnabled()
    • setStatisticsEnabled

      public void setStatisticsEnabled(String statisticsEnabled)
      Sets whether statistics is enabled.
    • getAnySpoolRules

      public String getAnySpoolRules()
    • setAnySpoolRules

      public void setAnySpoolRules(String anySpoolRules)
      Sets whether if just any of the StreamCachingStrategy.SpoolRule rules returns true then shouldSpoolCache(long) returns true. If this option is false, then all the StreamCachingStrategy.SpoolRule must return true.

      The default value is false which means that all the rules must return true.