camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woggle23 <>
Subject Re: camel-test-blueprint
Date Tue, 02 Oct 2012 10:13:00 GMT
I've found out how to register implementations of a service, but these don't
appear to be available when the camelcontext is created. My camel-context is
defined in blueprint similar to the following:

<reference id="cameraManager"

<camelContext xmlns="">
    <route id="test-route">
      <from uri="direct:start"/>
        <bean ref="cameraManager" method="getAllCameras" />
      <to uri="mock:a"/>

I've created a second blueprint file, for the purpose of the test, which
exposes an implementation of CameraManager as a service, the contents of
which is as follows:

<bean id="cameraManagerImpl"
class="org.myCompany.cameramanagerimpl.CameraManagerImpl" />

My getBlueprintDescriptor() method in the test returns both blueprint
descriptor files (the service implementing file first). The test fails as
the camel context isn't able to resolve dependencies for

However, if I remove my CamelContext descriptor from the
getBlueprintDescriptor() implementation in my test, when running a test I
can access the implementation of CameraManager, e.g:

import org.myCompany.cameramanager.CameraManager;

CameraManager cameraManager =
    ArrayList<Camera> cameras = cameraManager.getAllCameras();
    for (Camera camera : cameras){
      System.out.println(String.format("Camera id: %s", camera.getId()));

The above works, so why is the service not available to my CamelContext
during start up? Having a brief look at the CamelBlueprintHelper class in
the camel-test-blueprint component I note that a "TinyBundle" is created
containing both descriptors prior to the PojoServiceRegistry being created.
I'm not familiar with how these should be used, but is the bundle containing
both descriptors effectively starting prior to the creation of the
PojoServiceRegistry? If so, I could understand that the CameraManager
implementation isn't available.

In short is this a bug, or am I not using this correctly?

Please note, the test also logs all ServiceReferences, and I note that
org.myCompany.CameraManager is listed - I'm assuming that this is somehow
picked up from the Maven Dependency I have within my project?

Any help on this would be very much appreciated!



View this message in context:
Sent from the Camel Development mailing list archive at

View raw message