You need to start the direct-vm consumer before starting the direct-vm producer. Camel route startupOrder[1] can help you to do that.
[1]https://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On April 22, 2014 at 7:50:57 AM, John Dubchak (j...@johndubchak.com) wrote: > Hi, > > I am trying to route a JMS message using an xpath expression. The > expression and message conversion seem to work fine but I am getting an > error that one of the direct-vm endpoints are not found. > > Here is the structure of the router: > > DataFormat jaxb = new JaxbDataFormat(...); > > from(getInboundReceiver()) > .unmarshal(jaxb) > .choice() > .when(xpath(eventTypeOf("abc:inbound:file-receive"))) > .log("Dispatching event ${id} to receive handler") > .to("direct-vm:abc_InboundFileReceive") > .endChoice() > .when(xpath(eventTypeOf("abc:inbound:file-validate"))) > .log("Dispatching event ${id} to validation handler") > .to("direct-vm:abc_InboundFileValidate") > .endChoice() > .when(xpath(eventTypeOf("abc:inbound:file-process"))) > .log("Dispatching event ${id} to processing handler") > .process(applyProcessor) > .to("direct-vm:abc_InboundFileProcess") > .endChoice() > .otherwise() > .log("Processing ${id} did not match expressions."); > > In the abc_InboundFileValidate route I have: > > from("direct-vm:cdw_InboundFileValidate") > .... > > However, I have this error in the log file: > > DefaultErrorHandler | 108 - org.apache.camel.camel-core - > 2.12.3 | Failed delivery for (MessageId: > queue_abc.events_ID_host_name-65483-1398122729446-4_1_-1_1_1 on > ExchangeId: ID-host_name-65482-1398122729423-2-1). Exhausted after > delivery attempt: 1 caught: > org.apache.camel.component.directvm.DirectVmConsumerNotAvailableException: > No consumers available on endpoint: > Endpoint[direct-vm://abc_InboundFileValidate]. > Exchange[JmsMessage[JmsMessageID: > ID:host_name-65483-1398122729446-4:1:-1:1:1]] > > I know I'm probably doing something incorrectly, but I can't seem to > figure it out. Any help is appreciated. > > Thanks, > John >