I have several OSGi bundles (say A, B and C). Each of these bundles has its own Camel routes defined using Spring DM XML file.
I'd like to monitor each route by adding a wiretap at the beginning of each route. For example, the wiretaps would send data to a route defined in a different bundle (say Z)
...
<wiretap uri="direct-vm:data-gathering-route/>
...
In bundle Z, I would define the said route in a file named camelContext.xml
. Its location is META-INF/spring
, as follows:
<route>
<from uri="direct-vm:data-gathering-route"/>
...
</route>
The reason for defining this route in a separate bundle is because I don't want to repeat this in bundles A, B and C. So I hope I could import this route definition (within bundles A, B and C Camel Context files) using the Spring DM import statement, as follows:
<import resource="classpath:META-INF/spring/camelContext.xml"/>
When I deployed bundles A, B, C and Z in Karaf, it complains that it can't find the camelContext.xml
file.
Am I approaching this the right way?
Thanks.