Please use us...@camel.apache.org instead of dev@camel.apache.org for
support questions.


On Thu, Jan 23, 2014 at 7:55 AM, MohamedAli <triumph.mohamed...@gmail.com>wrote:

> *Main*
> List<String> msgList = new ArrayList<String>();
>                 msgList.add(place);
>                 msgList.add(placeTrip);
>                 msgList.add(place);
>                 msgList.add(tripStart);
>
>                 try {
>                         SpringCamelContext camelContext =
> SpringCamelContext
>
> .springCamelContext("Camel-Context.xml");
>                         System.out.println("Msg Pivot Test...");
>
>                         for (String msg : msgList) {
>                                 camelContext.start();
>
> camelContext.addRoutes(getRouteBuilder(msg, camelContext));
>                                 ProducerTemplate template = camelContext
>                                                 .createProducerTemplate();
>                                 //ConsumerTemplate consumerTemplate =
> camelContext.createConsumerTemplate();
>                                 //consumerTemplate.start();
>                                 template.sendBody(getConsumer(msg), msg);
>                                 //consumerTemplate.stop();
>                                 camelContext.stop();
>                         }
>                 } catch (Exception e) {
>                         e.printStackTrace();
>                         // TODO: handle exception
>                 }
>
> private static String getConsumer(String msg) {
>                 String builderName = null;
>                 if (msg != null) {
>                         if (msg.startsWith("$PLACE")) {
>                                 builderName = "direct:location";
>                         } else if (msg.startsWith("$READY")) {
>                                 builderName = "direct:trip";
>                         }
>                 }
>                 return builderName;
>         }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Bindy-with-multiple-model-and-multiple-RouteBuilder-tp5746377p5746378.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>

Reply via email to