Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The stream: component provides access to the System.in, System.out and System.err streams together with allowing streaming of output to a file .
Notice that some of the stream types has been @deprecated (file and url). These types are supported by their respective components.

URI format

Code Block
stream:in
stream:out
stream:err
stream:header

And the file and url is supported in Camel 2.0:

Code Block

stream:file?fileName?file=/foo/bar.txt  (@deprecated)
stream:url (@deprecated) 
stream:header

If the stream:header option is specified then the stream header is used to find the stream to write to. This option is only available for StreamProducer.

...

When using the stream:file notation this specifies the file name to stream to/from. @deprecated.

Name

Default Value

Description

file

null

delay

0

Initial delay in millis before consuming or producing the stream.

encoding

JVM Default

As of 1.4 or later you can configure the encoding (is a charset name) to use text based streams (eg. message body is a String object). If not provided Camel will use the JVM default Charset.

promptMessage

null

Camel 2.0: Leading prompt message that can be used when reading from stream:in to have a leading text such as Enter a command:

promptMessageDelay

0

Camel 2.0: Optional delay in millis before showing the prompt message. Can be used when system startup to avoid prompt message being written while other logging is done to the System out.

promptDelay

0

Camel 2.0: Optional delay in millis before showing the prompt message.

promptInitialDelay

2000

Camel 2.0: initial delay in millis before showing the prompt message. This delay only occurs once. Can be used when system startup to avoid prompt message being written while other logging is done to the System out.

fileName

null

Camel 2.0: When using the stream:file notation this specifies the file name to stream to/from.

scanStream

false

Camel 2.0: To be used for continuously reading a stream such as the unit tail command.

scanStreamDelay

0

Camel 2.0: Delay in millis between read attempts when using scanStream.

Message content

The stream: component supports either String or byte[] for writing to streams. Just add to the message.in.body either a Stirng or byte[] content.
The special stream:header URI is used for custom output streams. Just add a java.io.OutputStream to message.in.header in the key header.
See samples for an example.

...