Hi , 

I tried the splitter , like this : 

********

public ArrayList<ArrayList&lt;String>> simule_split_Many_Output(
                        Exchange exchange) {

                ArrayList<ArrayList&lt;String>> lstOflst = new
ArrayList<ArrayList&lt;String>>();
                ArrayList<String> lstOne = new ArrayList<String>();
                ArrayList<String> lstTwo = new ArrayList<String>();

                lstOne.add("MUST GO TO ROUTE A");
                lstTwo.add("MUST GO TO ROUTE B");

                lstOflst.add(lstOne);
                lstOflst.add(lstTwo);

                exchange.getOut().setHeader("ToAggregate", 1);
                exchange.getOut().setBody(lstOflst);

                return lstOflst;
        }

        public void getting_Array(Exchange exchange) {

                ArrayList<?> lst = exchange.getIn().getBody(ArrayList.class);

                System.out.println("IN getting_Array");
                System.out.println("DATA " + lst);
        }

******************

Then , 

        from("file:src/data?noop=true").to("direct:begin");
        
        from("direct:begin")
        .split()
        .method(BeanSimu.class, "simule_split_Many_Output")
        .bean(BeanSimu.class, "getting_Array")
        .to("mock:result");

*********************
The console shows :
IN getting_Array
DATA [MUST GO TO ROUTE A]
IN getting_Array
DATA [MUST GO TO ROUTE B].


How can i use the content based router ... .

if i add two other  method:


        public void route_for_A(Exchange exchange) {

                ArrayList<?> lst = exchange.getIn().getBody(ArrayList.class);

                System.out.println("route_for_A");
                System.out.println("DATA " + lst);
        }


        public void route_for_B(Exchange exchange) {

                ArrayList<?> lst = exchange.getIn().getBody(ArrayList.class);

                System.out.println("route_for_B");
                System.out.println("DATA " + lst);
        }

The first Array which contain "MUST GO TO ROUTE A" should go to route_for_A.
The second Array which contain "MUST GO TO ROUTE B" should go to
route_for_B.

How can i do that !!!

Thxs for help



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dispatch-Array-2-dimension-to-many-routes-tp5731266p5731325.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to