camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Sending route for execution
Date Sun, 04 Jan 2015 08:36:23 GMT
On Sat, Jan 3, 2015 at 11:44 AM, Tim Dudgeon <> wrote:
> I am trying to work out best approaches to sending a route to a remote
> CamelContext for execution. e.g. I have a client that generates the route
> definition and then needs to send it to a sever for execution.
> I notice that you can apply a new route to an existing context:
> Q. Is spring XML the only format supported?

No /spring is just the namespace for historical reasons. You can use
this with any kind of Camel (standalone, spring, war, blueprint, etc.)

> Q. Is there a way to generate the route using the Java object model and then
> generate the XML from that?

Yes all Camel routes become the model classes when Camel startup,
regardless how the end user define the routes: whether he/she uses
xml, java code, groovy code, scala code etc. It all becomes a graph of
those model classes.

And you can output those model classes in XML as they are JAXB
annotated. There is API to do that more easily. See this helper:

> I also see the ManagedCamelContextMBean.addOrUpdateRoutesFromXml() method:
> Q. Presumably this is the approach to use for remote deployment?

Yeah you can also update / add routes from xml over JMX as that api
supports. But yeah it does this at runtime and do not "save" the
updates. So if the JVM crashes the changes are "gone".

> I also seem to recall some mechanism for deploying camel "jobs" to a server,
> but can't find this right now. Is there such a thing.
> And in terms of scalability, I'm assuming that the CamelContext is quite a
> heavyweight object, so its better (in general terms) to deploy multiple
> routes to one context rather than end up with having a large number of
> contexts running each with one or two routes?

Kinda depends. How to slice and dice. Its more a deployment question
how independent you want these routes to be.

> Sorry for all the questions :-(
> Tim

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message