You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tom Howe <to...@artcore.com> on 2012/01/24 13:14:00 UTC

Is it possible to define Endpoints in a separate config file?

I came across
http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
It allows importing routes using <routeContext/>. Is there something
similar for Endpoints?

I'd like to have separate files for each so that I can create tests that
use the same Endpoints but different routes without having to replicate my
Endpoints in multiple files.

Thanks, Tom

Re: Is it possible to define Endpoints in a separate config file?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Another way is to define endpoints using property placeholders.
And then have a .properties file per environment.

People have done that for many years with Spring. So there is plenty
of docs how to do that as well.
And Camel in Action chapter 6 talks about this as well.

And we got some pieces of Camel wiki page as well
http://camel.apache.org/using-propertyplaceholder.html
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html

On Tue, Jan 24, 2012 at 1:14 PM, Tom Howe <to...@artcore.com> wrote:
> I came across
> http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
> It allows importing routes using <routeContext/>. Is there something
> similar for Endpoints?
>
> I'd like to have separate files for each so that I can create tests that
> use the same Endpoints but different routes without having to replicate my
> Endpoints in multiple files.
>
> Thanks, Tom



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Is it possible to define Endpoints in a separate config file?

Posted by Tom Howe <to...@artcore.com>.
Oh, I was under the impression the <endpoint/> had to go inside the
<camelcontext/>.
Which items can go outside of <camelcontext/> and what must go inside
<camelContext/>?




On Tue, Jan 24, 2012 at 1:42 PM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> If you have multiple XML files, then you can use xml:import or is it
> xml:include (or whatever, google that).
>
> Then you can define Camel endpoints in those other XML files, using
> the <endpoint> with the Camel namespace.
>
> <endpoint id="foo" url="activemq:queue:foo"
> xmlns="http://camel.apache.org/schema/spring"/>
>
>
>
> On Tue, Jan 24, 2012 at 1:14 PM, Tom Howe <to...@artcore.com> wrote:
> > I came across
> > http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
> > It allows importing routes using <routeContext/>. Is there something
> > similar for Endpoints?
> >
> > I'd like to have separate files for each so that I can create tests that
> > use the same Endpoints but different routes without having to replicate
> my
> > Endpoints in multiple files.
> >
> > Thanks, Tom
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Re: Is it possible to define Endpoints in a separate config file?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you have multiple XML files, then you can use xml:import or is it
xml:include (or whatever, google that).

Then you can define Camel endpoints in those other XML files, using
the <endpoint> with the Camel namespace.

<endpoint id="foo" url="activemq:queue:foo"
xmlns="http://camel.apache.org/schema/spring"/>



On Tue, Jan 24, 2012 at 1:14 PM, Tom Howe <to...@artcore.com> wrote:
> I came across
> http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
> It allows importing routes using <routeContext/>. Is there something
> similar for Endpoints?
>
> I'd like to have separate files for each so that I can create tests that
> use the same Endpoints but different routes without having to replicate my
> Endpoints in multiple files.
>
> Thanks, Tom



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

RE: Is it possible to define Endpoints in a separate config file?

Posted by Daniel Baptista <Da...@performgroup.com>.
Hi Tom, 
This might not be what you are looking for but have you seen this?

http://camel.apache.org/ref.html

I haven't used the above approach myself.

Hope it helps.
Dan.

-----Original Message-----
From: Tom Howe [mailto:tomhowe@artcore.com] 
Sent: 24 January 2012 12:14
To: users@camel.apache.org
Subject: Is it possible to define Endpoints in a separate config file?

I came across
http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
It allows importing routes using <routeContext/>. Is there something
similar for Endpoints?

I'd like to have separate files for each so that I can create tests that
use the same Endpoints but different routes without having to replicate my
Endpoints in multiple files.

Thanks, Tom