camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "calyan.bandi" <>
Subject Bindy dataformat usage in Spring v/s Java DSL
Date Wed, 21 Oct 2015 13:03:50 GMT

I am working on a camel route that reads an excel and does some processing.
I had this written in Spring DSL as shown below.

<from uri="file:csv?fileName=orders1.csv&amp;noop=true" />
<unmarshal ref="bindyDataFormat" />
<camel:process ref="displayExchange"></camel:process>    	
<to uri="direct:writeToCSVFile" />

In the processor, the exchange body i received is
java.util.ArrayList<Order>. Using a simple iterator i was able to do my

List<Order> orders = exchange.getIn().getBody(List.class);
for(Order order : orders)
  // simply reading the order object and doing processing

Recently, we moved to Java DSL and the code looks as below and below is how
we have our route written.

DataFormat bindy = new BindyCsvDataFormat("org.examples.camel.model");

		.process(new Processor() {

The exchange body that i have received in my processor is of type:
java.util.ArrayList<HashMap&lt;String, Object>>

Why is there a difference in the way the exchange body is created in both
the cases? The camel documentation for bindy data format - also tells that the exchange body will be
of type List<Map&lt;String, Object>> but this is not the case with Spring


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message