...
You can append query options to the URI in the following format, ?option=value&option=value&...
Options
Div | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||
Wiki Markup | ||||||||||||||||||||||||||||||||||||||||||
{div:class=confluenceTableSmall}
|| Name || Default Value || Description ||
| {{delay}} | {{0}} | Initial delay in milliseconds before consuming or producing the stream. |
| {{encoding}} | _JVM Default_ | You can configure the encoding (is a [charset name|http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html]) to use text-based streams (for example, message body is a {{String}} object). If not provided, Camel uses the [JVM default Charset|http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html#defaultCharset()]. |
| {{promptMessage}} | {{null}} | Message prompt to use when reading from {{stream:in}}; for example, you could set this to {{Enter a command:}} |
| {{promptDelay}} | {{0}} | Optional delay in milliseconds before showing the message prompt. |
| {{initialPromptDelay}} | {{2000}} | 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. |
| {{fileName}} | {{null}} | When using the {{stream:file}} URI format, this option specifies the filename to stream to/from. |
| {{url}} | {{null}} | 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|http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html] facility. |
| {{scanStream}} | {{false}} | To be used for continuously reading a stream such as the unix {{tail}} command.
*Camel 2.4 to Camel 2.6:* will retry opening the file if it is overwritten, somewhat like {{tail --retry}} |
| {{retry}} | {{false}} | *Camel 2.7:* will retry opening the file if it's overwritten, somewhat like {{tail --retry}} |
| {{scanStreamDelay}} | {{0}} | Delay in milliseconds between read attempts when using {{scanStream}}. |
| {{groupLines}} | {{0}} | *Camel 2.5:* 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. |
| {{autoCloseCount}} | {{0}} | *Camel 2.10.0:* (2.9.3 and 2.8.6) 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}} | {{false}} | *Camel 2.11.0:* 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. |
{div} |
Message content
The stream: component supports either String
or byte[]
for writing to streams. Just add either String
or byte[]
content to the message.in.body
. Messages sent to the stream: producer in binary mode are not followed by the newline character (as opposed to the String
messages). Message with null
body will not be appended to the output stream.
The special stream:header
URI is used for custom output streams. Just add a java.io.OutputStream
object to message.in.header
in the key header
.
See samples for an example.
...