2009/7/7 Oisin Hurley <[email protected]>: >>>> from("file://C:/Debug/from").id("File_0").to("file://C:/test").id("File_1"); > > This is a pretty cumbersome usage and it kind of clutters up the Java > for the route - but having ids on the various bits of the pipeline is really > very useful if you are debugging, or if you are visualizing the overall > route graph. > > It might be a better to decouple the id assignment from the Java route > specification - maybe there could be a concept of producing a strategy > for id allocation within a route, so basically Camel would automatically > allocate ids according to this strategy. It means no clutter in the Java > above as it would be done behind the scenes by the context. > > Strategies/policies could be like - 'type of endpoint plus appended > monotonically increasing non-negative integer', or 'call this implementation > of EndpointIdentificationStrategy with the URI and type of endpoint'.
As I just said in my previous mail, walking the nodes in a route calling idOrCreate() on them will automatically assign them a unique ID if they do not already have one. It should be pretty trivial to wrap that up in a little helper method; then end users don't have to even bother assigning IDs. -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/
