Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Base64 Data FormatAvailable as of Camel 2.11 Options
In Spring DSL, you configure the data format using this tag: <camelContext> <dataFormats> <!-- for a newline character (\n), use the HTML entity notation coupled with the ASCII code. --> <base64 lineSeparator=" " id="base64withNewLine" /> <base64 lineLength="64" id="base64withLineLength64" /> </dataFormats> ... </camelContext> Then you can use it later by its reference: <route> <from uri="direct:startEncode" /> <marshal ref="base64withLineLength64" /> <to uri="mock:result" /> </route> Most of the time, you won't need to declare the data format if you use the default options. In that case, you can declare the data format inline as shown below. MarshalIn this example we marshal the file content to base64 object. from("file://data.bin").marshal().base64().to("jms://myqueue"); In Spring DSL: <from uri="file://data.bin"> <marshal> <base64/> </marshal> <to uri="jms://myqueue"/> UnmarshalIn this example we unmarshal the payload from the JMS queue to a byte[] object, before its processed by the newOrder processor. from("jms://queue/order").unmarshal().base64().processRef("newOrder"); In Spring DSL: <from uri="jms://queue/order"> <marshal> <base64/> </marshal> <to uri="bean:newOrder"/> DependenciesTo use Base64 in your Camel routes you need to add a dependency on camel-base64 which implements this data format. If you use Maven you can just add the following to your pom.xml: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-base64</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> |