camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristiano Costantini <>
Subject Reusing definition of Data Formats
Date Wed, 30 Oct 2013 10:54:05 GMT
Hi All,

I'm using happily the <routeContext /> elements to define routes once and
then use them multiple times.
Well, I actually need to basically use the routes twice:
-  in the tests, with local endpoints and mocks
-  in production, inside karaf, where here are osgi service references I
don't have in tests

Today I needed to use a <dataformats /> but this break my strategy.

I use 3 spring beans xml files, "routes.xml", "test.xml" and "osgi.xml":
- "routes.xml" contains <routeContext/>
- "test.xml" contains a <camelContext/> for development and testing
- "osgi.xml" contains a <camelContext/> for deployment

in tests I run "routes.xml" and "test.xml", while in production I deploy
"routes.xml" and "osgi.xml"

I like this strategy because I change often the camel routes and in this
way I don't have to align the ones in the tests and the one deployed to

However <dataformats /> can't be used in <routeContext />, so I have to
define it in the <camelContext />, this mean I have to define a dataformat
in both "test.xml" and "osgi.xml"...

Anyone have an idea on how I can re-use a dataformat defined somewhere
In practice I would like to define the <dataformats> in "routes.xml" or
similar so I don't have to repeat that definition...

Thank you

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message