camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BAnanth <bhavani.ana...@wipro.com>
Subject Regarding traceExceptions in Tracer
Date Mon, 11 Feb 2013 10:06:41 GMT
Hi,

This is regarding the tracer functionality in camel.
We want to persist the trace information in derby database. We also want to
persist exception if any in the derby DB
As per the documentation, the latter can be accomplished by setting
traceExceptions = true;

But even after setting trace exception to true, the exceptions are not
getting logged.

Upon closer examination, in TracerInterceptor.java  we have the following
catch block, wherein we are logging the exception , but not persisting the
same in DB.

public boolean process(final Exchange exchange, final AsyncCallback
callback) {
......
........
try{
	.....
	......
	 public void done(boolean doneSync) {
                    try {
                      } catch (Throwable e) {
                        // some exception occurred in trace logic
                        if (shouldLogException(exchange)) {
                            logException(exchange, e);
                        }
                        exchange.setException(e);
                    } finally {
                        // ensure callback is always invoked
                        callback.done(doneSync);
                    }
                }
            });
	
	
}catch (Throwable e) {
            // some exception occurred in trace logic
            if (shouldLogException(exchange)) {
                logException(exchange, e);
            }
            exchange.setException(e);
        }

This could be rectified by calling the traceExchange(exchange) method in the
finally block. Please do let us know if we are correct.

Thanks and Regards,
Bhavani



--
View this message in context: http://camel.465427.n5.nabble.com/Regarding-traceExceptions-in-Tracer-tp5727336.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message