camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Kettelerij <richardkettele...@gmail.com>
Subject Re: Camel Bindy with multiple model and multiple RouteBuilder
Date Thu, 23 Jan 2014 08:07:23 GMT
Please use users@camel.apache.org instead of dev@camel.apache.org for
support questions.


On Thu, Jan 23, 2014 at 7:55 AM, MohamedAli <triumph.mohamedali@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message