Stream

Stream

Scheme: stream
Syntax: stream:kind
Description: The stream: component provides access to the system-in system-out and system-err streams as well as allowing streaming of file and URL.
Deprecated:false
Async:false
Maven: org.apache.camel/camel-stream/2.18.1.redhat-000005

The stream: component provides access to the system-in, system-out and system-err streams as well as allowing streaming of file and URL.

Name Kind Group Required Default Type Enum Description
kind path common true java.lang.String in
out
err
header
file
url
Kind of stream to use such as System.in or System.out.
encoding parameter common java.lang.String You can configure the encoding (is a charset name) to use text-based streams (for example, message body is a String object). If not provided, Camel uses the JVM default Charset.
fileName parameter common java.lang.String When using the stream:file URI format, this option specifies the filename to stream to/from.
url parameter common java.lang.String When using the stream:url URI format, this option specifies the URL to stream to/from. The input/output stream will be opened using the JDK URLConnection facility.
bridgeErrorHandler parameter consumer boolean Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored.
groupLines parameter consumer int To group X number of lines in the consumer. For example to group 10 lines and therefore only spit out an Exchange with 10 lines, instead of 1 Exchange per line.
groupStrategy parameter consumer org.apache.camel.component.stream.GroupStrategy Allows to use a custom GroupStrategy to control how to group lines.
initialPromptDelay parameter consumer 2000 long Initial delay in milliseconds before showing the message prompt. This delay occurs only once. Can be used during system startup to avoid message prompts being written while other logging is done to the system out.
promptDelay parameter consumer long Optional delay in milliseconds before showing the message prompt.
promptMessage parameter consumer java.lang.String Message prompt to use when reading from stream:in; for example, you could set this to Enter a command:
retry parameter consumer boolean Will retry opening the file if it's overwritten, somewhat like tail --retry
scanStream parameter consumer boolean To be used for continuously reading a stream such as the unix tail command.
scanStreamDelay parameter consumer long Delay in milliseconds between read attempts when using scanStream.
exceptionHandler parameter consumer (advanced) org.apache.camel.spi.ExceptionHandler To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored.
exchangePattern parameter consumer (advanced) org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the exchange pattern when the consumer creates an exchange.
autoCloseCount parameter producer int Number of messages to process before closing stream on Producer side. Never close stream by default (only when Producer is stopped). If more messages are sent, the stream is reopened for another autoCloseCount batch.
closeOnDone parameter producer boolean This option is used in combination with Splitter and streaming to the same file. The idea is to keep the stream open and only close when the Splitter is done, to improve performance. Mind this requires that you only stream to the same file, and not 2 or more files.
delay parameter producer long Initial delay in milliseconds before producing the stream.
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

stream consumer

Consumer that can read from streams