Using Camel Stream Component

The stream Camel component provides access to the, System.out and System.err streams as well as allowing streaming of file and URL.

When using the stream component, the following URI syntax is available:

  • stream:in[?options]
  • stream:out[?options]
  • stream:err[?options]
  • stream:header[?options]

In the following example, we are using the stream:out to perform a System.out of the content of files contained in the folder C:\Camel\In

package com.sample;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.DataFormat;

public class Hello {
  public static void main(String args[]) throws Exception {
    CamelContext context = new DefaultCamelContext();
    final DataFormat bindy = new BindyCsvDataFormat("com.sample.model");
        new RouteBuilder() {
          public void configure() {

Note that you can combine different type of streams in your route: for example, the following RouteBuilder takes an input stream from the Console and prints it to the System.out stream:

context.addRoutes(new RouteBuilder() {
  public void configure() {