Raghavan
Raghavan

Reputation: 21

What is the Camel endpoint for marshalling using bindy dataformat?

I have a requirement to dynamically create camel-bindy endpoint for marshalling the input. Below is the sample code:

<dataFormats>
  <bindy id="bookModel" type="Csv" classType="org.camelcookbook.transformation.csv.model.BookModel"/>
</dataFormats>
<route>
  <from uri="direct:unmarshal"/>
  <!-- <unmarshal ref="bookModel"/> -->
  <to uri="dataformat:bindy:unmarshal?ref=bookModel"/>      
</route>

Instead of unmarshal tag , I need to pass exchange to the equivalent end-point but getting error "Cannot find dataformat with name bindy"

Upvotes: 0

Views: 746

Answers (1)

Strelok
Strelok

Reputation: 51441

There are multiple bindy data formats: csv, fixed length, key-value pair.

Their respective data format names to use with the "dataformat:" endpoint uri are:

  • bindy-csv,
  • bindy-fixed,
  • bindy-kvp

So in your case you should specify unmarshalling like so:

<to uri="dataformat:bindy-csv:unmarshal?ref=bookModel"/>

Upvotes: 1

Related Questions