Re: Add property to Route (not Exchange)

2012-04-07 Thread Claus Ibsen
On Wed, Apr 4, 2012 at 9:53 PM, Jeff Segal wrote: > Sure. I have a system which manages Routes dynamically, which requires some > garbage collection to iterate through all Routes in the CamelContext and > remove any which are deemed no longer necessary. For the sake of > discussion, let's say that

Re: Add property to Route (not Exchange)

2012-04-06 Thread Reuben Garrett
Jeff, i can think of two approaches which might help: whenever possible, i try to map my routing logic onto declarative orchestrations of Enterprise Integration Patterns [1] to avoid interacting directly with Camel's API [2], neutral though it may be. perhaps your use-case can be satisfied by fa

Re: ).Re: Add property to Route (not Exchange)

2012-04-04 Thread Jeff Segal
I do not use OSGI unfortunately. The other possibility you describe is more or less exactly what I already created as a work-around. The main downside to it is that I have to manage the lifecycle of those properties separately from the Routes themselves rather than being all bundled together. On

Re: ).Re: Add property to Route (not Exchange)

2012-04-04 Thread Jeff Segal
Yeah that would certainly work, but would be less ideal than an arbitrary property map. I think I'd prefer to manage it myself the way I described in my work-around. On Wed, Apr 4, 2012 at 4:35 PM, Hadrian Zbarcea wrote: > Kinda. What about convention over configuration and have the color in the

Re: ).Re: Add property to Route (not Exchange)

2012-04-04 Thread Raul Kripalani
I don't suppose you use OSGi? If you do, you can export each route as an OSGi service assigning your own service properties. Another possibility is to maintain an application-wide singleton mimicking a route directory, where you keep a map of route ids and route properties. Your route builder woul

).Re: Add property to Route (not Exchange)

2012-04-04 Thread Hadrian Zbarcea
Kinda. What about convention over configuration and have the color in the route id (e.g. id="red.something" and if id.startsWith("red.") then garbage collect. Also keep in mind that the RouteBuilder creates just a model, not the route themselves. Hadrian On 04/04/2012 03:53 PM, Jeff Segal wro

Re: Add property to Route (not Exchange)

2012-04-04 Thread Jeff Segal
Sure. I have a system which manages Routes dynamically, which requires some garbage collection to iterate through all Routes in the CamelContext and remove any which are deemed no longer necessary. For the sake of discussion, let's say that I wanted to associate a "color" property with all Routes b

Re: Add property to Route (not Exchange)

2012-04-04 Thread Raul Kripalani
Hi Jeff, Could you explain your use case a bit further? It is not clear what you ultimately want to achieve. Regards, Raúl. On 4 April 2012 18:35, Jeff Segal wrote: > Is there any facility to add arbitrary properties to Routes rather than > just Exchanges from within a RouteBuilder? I noticed