2 Replies Latest reply on May 2, 2012 1:15 PM by nicolas duminil

    The "direct" component: how does it work ?

    nicolas duminil Master

      Greetings,

       

      Trying to figure out how does the direct component work. Reading the documentation it gives this example:

       

      from("activemq:queue:order.in")

          .to("bean:orderServer?method=validate")

          .to("direct:processOrder");

       

      from("direct:processOrder")

          .to("bean:orderService?method=process")

          .to("activemq:queue:order.out");

       

      Based on the understanding I get from this example, I would expect that the following works as well:

       

            from("file:{{product.file.inbox}}").to("direct:products-variants");

            from("file:{{variant.file.inbox}}").to("direct:products-variants");

            from("direct:product-variants").log("### We received: $(body)");

       

      What I would expect is to log the content of the files. Or even:

       

            from("file:{{product.file.inbox}}").to("direct:products-variants");

            from("file:{{variant.file.inbox}}").to("direct:products-variants");

            from("direct:product-variants").to("file:{{product.variant.file.outbox}}?fileExist=Append");

       

      to append the files. But none of previous routes work. Is that expected or am I doing an error ?

       

      Many thanks in advance,

       

      Nicolas