3 Transforming data with Camel

 

This chapter covers

  • Transforming data by using EIPs and Java
  • Transforming XML data
  • Transforming by using well-known data formats
  • Writing your own data formats for transformations
  • Understanding the Camel type-converter mechanism

The preceding chapter covered routing, which is the single most important feature any integration kit must provide. This chapter looks at the second most important feature: data or message transformation.

Just like the real world, where people speak different languages, the IT world speaks different protocols. Software engineers regularly need to act as mediators between various protocols when IT systems must be integrated. To address this, the data models used by the protocols must be transformed from one form to another, adapting to whatever protocol the receiver understands. Mediation and data transformation are key features in any integration kit, including Camel.

In this chapter, you’ll learn all about how Camel can help you with your data transformation challenges. We’ll start with a brief overview of data transformation in Camel and then look at transforming data into any custom format you may have. Next we’ll look at Camel components that are specialized for transforming XML data and other well-known data formats. We end the chapter by looking into Camel’s type-converter mechanism, which supports, implicitly and explicitly, type conversion.

3.1 Data transformation overview

3.2 Transforming data by using EIPs and Java

3.2.1 Using the Message Translator EIP

3.2.2 Using the Content Enricher EIP

3.3 Transforming XML

3.3.1 Transforming XML with XSLT

3.3.2 Transforming XML with object marshaling

3.4 Transforming with data formats

3.4.1 Data formats provided with Camel

3.4.2 Using Camel’s CSV data format

3.4.3 Using Camel’s Bindy data format

3.4.4 Using Camel’s JSON data format

3.4.5 Configuring Camel data formats

3.5 Transforming with templates

3.5.1 Using Apache Velocity

3.6 Understanding Camel type converters

3.6.1 How the Camel type-converter mechanism works

3.6.2 Using Camel type converters

3.6.3 Writing your own type converter

3.7 Summary and best practices

sitemap