Hello,
I have tried to send message string to single model and single routebuilder
it works fine!!!
I have List of String which is sent to bindy to convert into POJO from
multiple model with multiple routebuilder, but it not not working.
Please find the sample below and guilde to fix the issue.

*camel-context.xml*
<camel:camelContext id="camelContextBean" trace="true"
lazyLoadTypeConverters="false"
                autoStartup="false">
                <camel:routeBuilder id="tripStartBuilder" 
ref="tripStartBuilder"/>
                <camel:routeBuilder id="pivotBuilder" ref="pivotBuilder" />
        </camel:camelContext>

        <bean id="pivotBuilder"
class="com.smart.listener.message.builder.PivotBuilder" />
        <bean id="tripStartBuilder"
class="com.smart.listener.message.builder.TripStartBuilder" />

*PivotBuilder extends RouteBuilder*
        @Override
        public void configure() throws Exception {
                DataFormat bindy = new BindyCsvDataFormat(LocationPivot.class);
                
                System.out.println("PivotBuilder..."    );
                from("direct:location").unmarshal(bindy).process(new 
Processor() {

                        public void process(Exchange exchange) throws Exception 
{
                                Message in = exchange.getIn();
                                /*List<Map&lt;String, Object>> model = 
(List<Map&lt;String, Object>>) in
                                                .getBody();*/
                                LocationPivot locPvt = 
(LocationPivot)in.getBody();
                                //BasicMsgPivot locPvt =
(BasicMsgPivot)model.get(0).values().toArray()[0];
                                System.out.println(locPvt.getMsgInd());
                                System.out.println(locPvt.getImeiNo());

                        }
                });
        }

*TripStartBuilder extends RouteBuilder*
@Override
        public void configure() throws Exception {
                DataFormat bindy = new BindyCsvDataFormat(TripStartPivot.class);
                
                System.out.println("TripStartBuilder...");
                from("direct:trip").unmarshal(bindy).process(new Processor() {

                        public void process(Exchange exchange) throws Exception 
{
                                Message in = exchange.getIn();
                                /*List<Map&lt;String, Object>> model = 
(List<Map&lt;String, Object>>) in
                                                .getBody();*/
                                //BasicMsgPivot locPvt =
(BasicMsgPivot)model.get(0).values().toArray()[0];
                                TripStartPivot trPvt = 
(TripStartPivot)in.getBody();
                                System.out.println(trPvt.getMsgInd());
                                System.out.println(trPvt.getImeiNo());

                        }
                });

*@CsvRecord(separator = ",")
public class LocationPivot extends BasicMsgPivot {*

        @DataField(pos = 1)
        private String msgInd;

        @DataField(pos = 2)
        private BigDecimal imeiNo;

        @DataField(pos=3, pattern="ddMMyy")
        private Date currDate;

*@CsvRecord(separator = ",")
public class TripStartPivot extends BasicMsgPivot{*
        
        @DataField(pos = 1)
        private String msgType;

        @DataField(pos = 2)
        private BigDecimal test;

        @DataField(pos=3, pattern="ddMMyy")
        private Date team;



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Bindy-with-multiple-model-and-multiple-RouteBuilder-tp5746377.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to