Package org.apache.camel.core.xml
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAllowClasses(String allowClasses) To filter stream caching of a given set of allowed/denied classes.voidsetAnySpoolRules(String anySpoolRules) Sets whether if just any of theStreamCachingStrategy.SpoolRulerules returns true then shouldSpoolCache(long) returns true.voidsetBufferSize(String bufferSize) Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.voidsetDenyClasses(String denyClasses) To filter stream caching of a given set of allowed/denied classes.voidsetEnabled(String enabled) Sets whether stream caching is enabled or not.voidsetRemoveSpoolDirectoryWhenStopping(String removeSpoolDirectoryWhenStopping) Whether to remove the temporary directory when stopping.voidsetSpoolCipher(String spoolCipher) Sets a cipher name to use when spooling to disk to write with encryption.voidsetSpoolDirectory(String spoolDirectory) Sets the spool (temporary) directory to use for overflow and spooling to disk.voidsetSpoolEnabled(String spoolEnabled) To enable stream caching spooling to disk.voidsetSpoolRules(String spoolRules) Reference to one or more customStreamCachingStrategy.SpoolRuleto use.voidsetSpoolThreshold(String spoolThreshold) Threshold in bytes when overflow to disk is activated.voidsetSpoolUsedHeapMemoryLimit(String spoolUsedHeapMemoryLimit) Sets what the upper bounds should be when spoolUsedHeapMemoryThreshold is in use.voidsetSpoolUsedHeapMemoryThreshold(String spoolUsedHeapMemoryThreshold) Sets a percentage (1-99) of used heap memory threshold to activate spooling to disk.voidsetStatisticsEnabled(String statisticsEnabled) Sets whether statistics is enabled.Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
Constructor Details
-
CamelStreamCachingStrategyDefinition
public CamelStreamCachingStrategyDefinition()
-
-
Method Details
-
getEnabled
-
setEnabled
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
-
setAllowClasses
To filter stream caching of a given set of allowed/denied classes. By default, all classes that areInputStreamis allowed. Multiple class names can be separated by comma. -
getDenyClasses
-
setDenyClasses
To filter stream caching of a given set of allowed/denied classes. By default, all classes that areInputStreamis allowed. Multiple class names can be separated by comma. -
getSpoolEnabled
-
setSpoolEnabled
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
-
setSpoolDirectory
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
-
setSpoolCipher
Sets a cipher name to use when spooling to disk to write with encryption. By default the data is not encrypted. -
getSpoolThreshold
-
setSpoolThreshold
Threshold in bytes when overflow to disk is activated. The default threshold isStreamCache.DEFAULT_SPOOL_THRESHOLDbytes (eg 128kb). Use -1 to disable overflow to disk. -
getSpoolUsedHeapMemoryThreshold
-
setSpoolUsedHeapMemoryThreshold
Sets a percentage (1-99) of used heap memory threshold to activate spooling to disk. -
getSpoolUsedHeapMemoryLimit
-
setSpoolUsedHeapMemoryLimit
Sets what the upper bounds should be when spoolUsedHeapMemoryThreshold is in use. -
getSpoolRules
-
setSpoolRules
Reference to one or more customStreamCachingStrategy.SpoolRuleto use. Multiple rules can be separated by comma. -
getBufferSize
-
setBufferSize
Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches. The default size isIOHelper.DEFAULT_BUFFER_SIZE -
getRemoveSpoolDirectoryWhenStopping
-
setRemoveSpoolDirectoryWhenStopping
Whether to remove the temporary directory when stopping. This option is default true -
getStatisticsEnabled
-
setStatisticsEnabled
Sets whether statistics is enabled. -
getAnySpoolRules
-
setAnySpoolRules
Sets whether if just any of theStreamCachingStrategy.SpoolRulerules returns true then shouldSpoolCache(long) returns true. If this option is false, then all theStreamCachingStrategy.SpoolRulemust return true. The default value is false which means that all the rules must return true.
-