You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by John Dubchak <jo...@johndubchak.com> on 2014/04/22 01:50:23 UTC

Basic direct-vm scenario produces error

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

Re: Basic direct-vm scenario produces error

Posted by John Dubchak <jo...@johndubchak.com>.
Thanks, Raul, it was a naming error.

On 4/21/14, 5:18 PM, Raul Kripalani wrote:
> Check the endpoint URIs on the producer and consumer side. There seems to
> be a mismatch - perhaps it's a copy paste error?
> On 22 Apr 2014 00:50, "John Dubchak" <jo...@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
>>
>

Re: Basic direct-vm scenario produces error

Posted by Raul Kripalani <ra...@evosent.com>.
Check the endpoint URIs on the producer and consumer side. There seems to
be a mismatch - perhaps it's a copy paste error?
On 22 Apr 2014 00:50, "John Dubchak" <jo...@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
>

Re: Basic direct-vm scenario produces error

Posted by Willem Jiang <wi...@gmail.com>.
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 (john@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
>