The String DataFormat Data Format is a text based data format textual based 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");
|
Dependencies
This data format is provided in camel-core so no additional dependencies is needed.