3

I am working with Apache Camel Bindy to process csv files of different data models. e.g. file one is of data model on and file two is of data model two. In the camel route, I associated two calls of the BindyCsvDataFormat with different data models as:

<bean id="bindyDataformat" class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">        
    <constructor-arg name="type" value="com.barclays.creditit.cls.eoddata.model.risk.DataModel1" />
</bean>

<bean id="aBindyDataformat" class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
    <constructor-arg name="type" value="DataModel2" />
</bean>

route looks like this:

        <from uri="direct:start"/>
        <bean ref="fileReader"/>
        <unmarshal ref="bindyDataformat" />
        <bean ref="flattener"/>
        <bean ref="fileReader"/>
        <unmarshal ref="aBindyDataformat" />
        <bean ref="flattener"/>

When I run the code though, the factory has two models associated automatically, not one per run. And both the files are read into objects of the first data model and never the second data model. Any suggestions about how I could get this to work?

Thanks!

Ramya B
  • 31
  • 2

1 Answers1

0

Create two different routes with different file filters and process them separately with one of the Bindy formaters.

Peter Keller
  • 7,526
  • 2
  • 26
  • 29