camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé BARRAULT <>
Subject ProducerTemplate and Exception Management
Date Fri, 17 Aug 2012 16:20:03 GMT
I used a producer template to send a body.

I have found a method which is

void *sendBody*(String
              throws CamelExecutionException

I have done some tests and only catch this exception as written in the

But during my testing i had a configuration issue due to dynamic
endpoint and I have seen that another exception can be thrown by this
method which were not managed by the code.
The following Exception is : NoSuchEndpointException

I have seen thas this exception can be a usual error :

My question is why this exception is not intercepted by the producer
template and wrapped in a CamelExecutionException as defined in the
prototype of the method ?

I know that I am using an old version of camel (2.4.0-fuse-00-00) but
I looked to sources and the method which throws the exception has not
change since 2.4.0.
protected Endpoint resolveMandatoryEndpoint(String endpointUri) {
       Endpoint endpoint = context.getEndpoint(endpointUri);
       if (endpoint == null) {
           throw new NoSuchEndpointException(endpointUri);
       return endpoint;

Could it be a good idea to wrap this exception or add it in the
documentation in order to avoid missing error cases ?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message