I'm using Camel 2.13.1 and have a weird behaviour. If I want to test my routes I've written in XML.
I always get the message on one route that no consumers are available. If I deploy this on Tomcat everything is working fine. Even on startup I can see the log that clearly states that the route is consumed.
My routes looks like that:
<route id="demo-polling-consumer">
<from uri="timer:demo-polling?fixedRate=true&period=60s" />
<to uri="bean:demo?method=selectDemoCustomer" />
<to uri="direct-vm:demo-get-new-orders" />
<split>
<simple>${body}</simple>
<to uri="direct-vm:demo-get-order-details" />
</split>
</route>
<route id="epunkt-get-new-jobadverts">
<from uri="direct-vm:demo-get-order-details" />
<to uri="bean:demo?method=getOrderDetail" />
</route>
I start the test like that:
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
@ContextConfiguration(locations = { "classpath:spring-module.xml" })
public class FirstBirdContextTest {
@EndpointInject(uri = "mock:out")
private MockEndpoint mockOut;
@Produce(uri = "direct:in")
private ProducerTemplate in;
@Test
public void testPayloadIsTransformed() throws InterruptedException, FileNotFoundException, JAXBException {
}
I basically just start my spring-context. The spring-module.xml loads multiple camel-context.xml files.
The error says:
org.apache.camel.component.directvm.DirectVmConsumerNotAvailableException: No consumers available on endpoint: Endpoint[direct-vm:demo-get-order-details]. Exchange[Message: [[Ljava.lang.Object;@6dd62653]]
The startup log says
[ main] SpringCamelContext INFO Route: orderdetails started and consuming from: Endpoint[direct-vm:demo-get-order-details]
Again. If I deploy that on tomcat everything works fine.