title: Apache camel route not calling another camel route
body: <p>I have three camel routes running fine individually, I am trying to call second route once first route is complete, but some how it is not being initiated how event third route is running once I call second route using URL <code>jetty:http://localhost:8181/mongoSelect</code> , I have no error on the console as well. I have already tried changing <code>from("jetty:http://localhost:8181/mongoSelect")</code> with <code>direct:</code> component, Please help me on this.</p>
  
  <p><strong>Constants</strong></p>
  
  <pre><code>private static final String SOURCE = "file:\\workspace\\EmailResponseAutomationSTS\\response\\?noop=true";
  private static final String DESTINATION = "mongodb:myDb?database=email_response&amp;collection=emailResponse&amp;operation=save";
  private static final String QUERY_MONGO_DB = "mongodb:myDb?database=email_response&amp;collection=emailResponse&amp;operation=findAll";
  </code></pre>
  
  <p><strong>First Route</strong></p>
  
  <pre><code>from(SOURCE)
          .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  final EmailResponseModel erm = new EmailResponseModel();
                  erm.setBody(exchange.getIn().getBody(String.class));
                  exchange.getIn().setBody(erm, DBObject.class);
              }
          })
          .to(DESTINATION)
          .end();
  </code></pre>
  
  <p><strong>Second Route</strong></p>
  
  <pre><code>from("jetty:http://localhost:8181/mongoSelect")
          .to(QUERY_MONGO_DB)
          .marshal(new JacksonDataFormat())
          .to("direct:redis")
          .end();
  </code></pre>
  
  <p><strong>Third Route</strong></p>
  
  <pre><code>from("direct:redis").process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
  
                  final String name = exchange.getIn().getBody(String.class);
                  @SuppressWarnings({ "deprecation", "unchecked" })
                  List&lt;BasicDBObject&gt; obj = (List&lt;BasicDBObject&gt;) JSON.parse(name);
  
                  for(BasicDBObject model : obj) {
                      String s = model.getString("body");
                      jedis.set("mongoData", s); 
                  }
                  jedis.close();
              }
          })
          .end();
  </code></pre>
  
  <p>I have already tried this approach:</p>
  
  <p><strong>First Route</strong></p>
  
  <pre><code>from(SOURCE)
          .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  final EmailResponseModel erm = new EmailResponseModel();
                  erm.setBody(exchange.getIn().getBody(String.class));
                  exchange.getIn().setBody(erm, DBObject.class);
              }
          })
          .to(DESTINATION)
          .to("direct:mongoSelect")
          .end();
  </code></pre>
  
  <p><strong>Second Route</strong></p>
  
  <pre><code>from("direct:mongoSelect")
  .to(QUERY_MONGO_DB)
  .marshal(new JacksonDataFormat())
  .to("direct:redis")
  .end();
  </code></pre>
  
  <p><strong>UPDATE :</strong> Something strange is happening with my code, when I am calling second route from first route using <code>direct:mongoSelect</code> component, control is moving in but there is no data in response from <code>.to(QUERY_MONGO_DB)</code>, however if I am using <code>from("jetty:http://localhost:8181/mongoSelect")</code> instead of <code>from("direct:mongoSelect")</code> in second route, I am getting data in response.</p>
  
  <p><strong>First Route</strong></p>
  
  <pre><code>from(SOURCE)
          .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  final EmailResponseModel erm = new EmailResponseModel();
                  erm.setEmailBody(exchange.getIn().getBody(String.class));
                  exchange.getIn().setBody(erm, DBObject.class);
              }
          })
          .to(DESTINATION)
          .to("direct:mongoSelect");
  </code></pre>
  
  <p><strong>Second Route</strong></p>
  
  <pre><code>from("direct:mongoSelect")
          .to(QUERY_MONGO_DB)
          .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                  String srt = exchange.getIn().getBody(String.class);
                  exchange.getIn().setBody(srt, DBObject.class);
              }
          })
          .to("direct:redis")
          .end();
  </code></pre>