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 Constructor Description CamelStreamCachingStrategyDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAnySpoolRules()
String
getBufferSize()
String
getEnabled()
String
getRemoveSpoolDirectoryWhenStopping()
String
getSpoolCipher()
String
getSpoolDirectory()
String
getSpoolEnabled()
String
getSpoolRules()
String
getSpoolThreshold()
String
getSpoolUsedHeapMemoryLimit()
String
getSpoolUsedHeapMemoryThreshold()
String
getStatisticsEnabled()
void
setAnySpoolRules(String anySpoolRules)
Sets whether if just any of theStreamCachingStrategy.SpoolRule
rules returns true then shouldSpoolCache(long) returns true.void
setBufferSize(String bufferSize)
Sets the buffer size to use when allocating in-memory buffers used for in-memory stream caches.void
setEnabled(String enabled)
Sets whether stream caching is enabled or not.void
setRemoveSpoolDirectoryWhenStopping(String removeSpoolDirectoryWhenStopping)
Whether to remove the temporary directory when stopping.void
setSpoolCipher(String spoolCipher)
Sets a cipher name to use when spooling to disk to write with encryption.void
setSpoolDirectory(String spoolDirectory)
Sets the spool (temporary) directory to use for overflow and spooling to disk.void
setSpoolEnabled(String spoolEnabled)
To enable stream caching spooling to disk.void
setSpoolRules(String spoolRules)
Reference to one or more customStreamCachingStrategy.SpoolRule
to use.void
setSpoolThreshold(String spoolThreshold)
Threshold in bytes when overflow to disk is activated.void
setSpoolUsedHeapMemoryLimit(String spoolUsedHeapMemoryLimit)
Sets what the upper bounds should be when spoolUsedHeapMemoryThreshold is in use.void
setSpoolUsedHeapMemoryThreshold(String spoolUsedHeapMemoryThreshold)
Sets a percentage (1-99) of used heap memory threshold to activate spooling to disk.void
setStatisticsEnabled(String statisticsEnabled)
Sets whether statistics is enabled.
-
-
-
Method Detail
-
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.
-
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 isStreamCache.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 customStreamCachingStrategy.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 isIOHelper.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 theStreamCachingStrategy.SpoolRule
rules returns true then shouldSpoolCache(long) returns true. If this option is false, then all theStreamCachingStrategy.SpoolRule
must return true. The default value is false which means that all the rules must return true.
-
-