1 Reply Latest reply on Sep 3, 2013 1:43 PM by Keith Babo

    Redundant from() in Camel Java DSL

    pzl_mz Newbie

      Is it possible to get rid of the from("switchyard://SomeSerivice") in a Camel Java DSL? I think this feature existed in the inline route( implementation.camel )  but since inline routes are not allowed anymore I can't find a solution to remove this redundancy.

        • 1. Re: Redundant from() in Camel Java DSL
          Keith Babo Master

          It is not possible to get rid of the from() endpoint in Camel routes.  Funny enough, we used to allow that to go unspecified but got feedback that it was too funky/different from how Camel routes are traditionally specified.  Be that as it may, the switchyard endpoint does have some utility:


          1) We allow multiple route definitions in a Java or XML DSL definition pointed to by implementation.camel.  Having a from("switchyard://") endpoint clearly identifies which route is the "entry point" for the service.

          2) Internal dispatch to a Camel route is done via a SwitchYard camel component, so the endpoint needs to be there one way or the other.  Doing it in the background on deployment is possible, but as I mentioned above that seems to create more problems than it solves.