...
- The XStream library and Jettsion
- The Jackson library
- Camel 2.10: The GSon library
By default Camel uses the XStream library.
...
Code Block |
---|
// lets turn Object messages into json then send to MQSeries
from("activemq:My.Queue").
marshal().json(JsonLibrary.Jackson).
to("mqseries:Another.Queue");
|
Using Json data format with the GSON library
Code Block |
---|
// lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(JsonLibrary.Gson). to("mqseries:Another.Queue"); |
...
If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions).
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-xstream</artifactId> <version>2.0</version> </dependency> |
...
If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions).
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>2.0</version>
</dependency>
|
Dependencies for GSON
To use JSON in your camel routes you need to add the a dependency on camel-gson which implements this data format.
If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions).
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-gson</artifactId>
<version>2.10</version>
</dependency>
|