1 Reply Latest reply on Dec 15, 2009 8:47 PM by njiang

    testing and deploying routes using configuration parameters

    lyfe

      Based on what I've read on Camel and route testing with mock endpoints, I would have to define the routes twice for my scenario.  Once for testing and again for deployment.

       

      I'm using Java DSL to code my routes.  Is there a way to code the routes once and, somehow, configure parameters representing endpoints to point to different endpoints?  Eg, doing testing, I would use mock:start and mock:results..however, when deployed, would use jbi endpoints.  This change would be similar to having a property file.

       

      An example route I'm using is:

       

      from("jbi:endpoint:http://my.entry/http/listener")

      .to("direct:content-based-routing");

       

      from("direct:content-based-routing")

      .choice()

      .when().method("myBean","isTrue")

      .to("direct:positive-input")

      .otherwise()

      .to("direct:negative-input")

      .end();

       

      from("direct:positive-input")

      .to("jbi:endpoint:http://my.exit/PositiveService/Plus?mep=in-out");

       

      from("direct:negative-input")

      .to("jbi:endpoint:http://my.exit/NegativeService/Negative?mep=in-out");