You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Thomas Weinschenk <th...@infoserve.endress.com> on 2016/02/10 15:58:12 UTC

onCompletion has no Exception / CamelExceptionCaught (anymore)

Hi folks,

I am working on a monitoring system to trace the traffic handled by camel.
>From importance is the failure handling of course.
No I facing the problem that there is no Exception information within an
onCompletion block accessible. Neither by exchange.getException() nor via
the property CamelExceptionCaught (Exchange.EXCEPTION_CAUGHT).

Here is an example route:
from(direct:fail)
.onCompletion().to("log:thisIsTheEnd?showAll=true").end()
.throwException(new FileNotFoundException("doing"));

It used to work with 2.12.4 but from 2.12.5 onwards there is no information
about the exception anymore.
Here are the example logs:

*2.12.4:*
[thisIsTheEnd] - Exchange[Id: ID-123-61128-1455114799503-0-3,
ExchangePattern: InOnly, 
Properties: {CamelCorrelationId=ID-123-61128-1455114799503-0-2,
CamelCreatedTimestamp=Wed Feb 10 15:33:19 CET 2016,
CamelErrorHandlerHandled=false,
CamelExceptionCaught=java.io.FileNotFoundException: doing,
CamelFailureEndpoint=direct://fail, CamelFailureHandled=true,
CamelFailureRouteId=FailRoute,
CamelMessageHistory=[DefaultMessageHistory[routeId=FailRoute,
node=onCompletion1], DefaultMessageHistory[routeId=FailRoute,
node=throwException1], DefaultMessageHistory[routeId=FailRoute, node=to1]],
CamelOnCompletion=true, CamelToEndpoint=log://thisIsTheEnd?showAll=true}, 
Headers: {breadcrumbId=ID-123-61128-1455114799503-0-1,
CamelRedelivered=false, CamelRedeliveryCounter=0}, 
BodyType: String, Body: abc, 
CaughtExceptionType: java.io.FileNotFoundException, 
CaughtExceptionMessage: doing, 
StackTrace: java.io.FileNotFoundException: doing
	....stack trace...
, 
Out: null: ]

*Since 2.12.5:*
[thisIsTheEnd] - Exchange[Id: ID-123-61109-1455114738501-0-4,
ExchangePattern: InOnly, 
Properties: {CamelCorrelationId=ID-123-61109-1455114738501-0-2,
CamelCreatedTimestamp=Wed Feb 10 15:32:18 CET 2016,
CamelFailureEndpoint=direct://fail, CamelFailureRouteId=FailRoute,
CamelMessageHistory=[DefaultMessageHistory[routeId=FailRoute,
node=onCompletion1], DefaultMessageHistory[routeId=FailRoute,
node=throwException1], DefaultMessageHistory[routeId=FailRoute, node=to1]],
CamelOnCompletion=true, CamelToEndpoint=log://thisIsTheEnd?showAll=true}, 
Headers: {breadcrumbId=ID-123-61109-1455114738501-0-1,
CamelRedelivered=false, CamelRedeliveryCounter=0}, 
BodyType: String, 
Body: abc, 
Out: null: ]


Regards,
Thomas




--
View this message in context: http://camel.465427.n5.nabble.com/onCompletion-has-no-Exception-CamelExceptionCaught-anymore-tp5777544.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: onCompletion has no Exception / CamelExceptionCaught (anymore)

Posted by Thomas Weinschenk <th...@infoserve.endress.com>.
Hi Claus,

Perfect CAMEL-9504 addressed and solved my problem 

Regards,
Thomas



--
View this message in context: http://camel.465427.n5.nabble.com/onCompletion-has-no-Exception-CamelExceptionCaught-anymore-tp5777544p5777566.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: onCompletion has no Exception / CamelExceptionCaught (anymore)

Posted by Claus Ibsen <cl...@gmail.com>.
I think there is a ticket logged about this, check the JIRA

On Wed, Feb 10, 2016 at 3:58 PM, Thomas Weinschenk
<th...@infoserve.endress.com> wrote:
> Hi folks,
>
> I am working on a monitoring system to trace the traffic handled by camel.
> From importance is the failure handling of course.
> No I facing the problem that there is no Exception information within an
> onCompletion block accessible. Neither by exchange.getException() nor via
> the property CamelExceptionCaught (Exchange.EXCEPTION_CAUGHT).
>
> Here is an example route:
> from(direct:fail)
> .onCompletion().to("log:thisIsTheEnd?showAll=true").end()
> .throwException(new FileNotFoundException("doing"));
>
> It used to work with 2.12.4 but from 2.12.5 onwards there is no information
> about the exception anymore.
> Here are the example logs:
>
> *2.12.4:*
> [thisIsTheEnd] - Exchange[Id: ID-123-61128-1455114799503-0-3,
> ExchangePattern: InOnly,
> Properties: {CamelCorrelationId=ID-123-61128-1455114799503-0-2,
> CamelCreatedTimestamp=Wed Feb 10 15:33:19 CET 2016,
> CamelErrorHandlerHandled=false,
> CamelExceptionCaught=java.io.FileNotFoundException: doing,
> CamelFailureEndpoint=direct://fail, CamelFailureHandled=true,
> CamelFailureRouteId=FailRoute,
> CamelMessageHistory=[DefaultMessageHistory[routeId=FailRoute,
> node=onCompletion1], DefaultMessageHistory[routeId=FailRoute,
> node=throwException1], DefaultMessageHistory[routeId=FailRoute, node=to1]],
> CamelOnCompletion=true, CamelToEndpoint=log://thisIsTheEnd?showAll=true},
> Headers: {breadcrumbId=ID-123-61128-1455114799503-0-1,
> CamelRedelivered=false, CamelRedeliveryCounter=0},
> BodyType: String, Body: abc,
> CaughtExceptionType: java.io.FileNotFoundException,
> CaughtExceptionMessage: doing,
> StackTrace: java.io.FileNotFoundException: doing
>         ....stack trace...
> ,
> Out: null: ]
>
> *Since 2.12.5:*
> [thisIsTheEnd] - Exchange[Id: ID-123-61109-1455114738501-0-4,
> ExchangePattern: InOnly,
> Properties: {CamelCorrelationId=ID-123-61109-1455114738501-0-2,
> CamelCreatedTimestamp=Wed Feb 10 15:32:18 CET 2016,
> CamelFailureEndpoint=direct://fail, CamelFailureRouteId=FailRoute,
> CamelMessageHistory=[DefaultMessageHistory[routeId=FailRoute,
> node=onCompletion1], DefaultMessageHistory[routeId=FailRoute,
> node=throwException1], DefaultMessageHistory[routeId=FailRoute, node=to1]],
> CamelOnCompletion=true, CamelToEndpoint=log://thisIsTheEnd?showAll=true},
> Headers: {breadcrumbId=ID-123-61109-1455114738501-0-1,
> CamelRedelivered=false, CamelRedeliveryCounter=0},
> BodyType: String,
> Body: abc,
> Out: null: ]
>
>
> Regards,
> Thomas
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/onCompletion-has-no-Exception-CamelExceptionCaught-anymore-tp5777544.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2