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-traceException-in-tracer-tp5727342.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to