Versions Compared

Key

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

The String Data Format is a text textual based data format that supports encoding.

Options

Option

Default

Description

charset

null

To use a specific charset for encoding.

...

If not provided Camel will use the JVM default charset.

Marshal

In this example we marshal the file content to String object in UTF-8 encoding

Code Block

from("file://data.csv").marshal().string("UTF-8").to("jms://myqueue");

Unmarshal

In this example we unmarshal the payload from the JMS queue to a String object using UTF-8 encoding, before its processed by the newOrder processor.

Code Block

from("jms://queue/order").unmarshal().string("UTF-8").processRef("newOrder");