Java Code Examples for org.apache.camel.Exchange.getException()

The following are Jave code examples for showing how to use getException() of the org.apache.camel.Exchange class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eds   File: PerformanceLogHelper.java   Source Code and License Vote up 5 votes
public void error(Exchange exchange){
  Object obj = exchange.getProperty(EXCHANGE_PERF_PROPERTY);
  long cost = -1;
  if(obj != null){
    cost = System.currentTimeMillis() - (long) obj;
    exchange.removeProperty(EXCHANGE_PERF_PROPERTY);
  }
  String ex = "";
  if(exchange.getException() != null){
    ex = exchange.getException().getMessage();
    exchange.removeProperty(EXCHANGE_PERF_PROPERTY);
  }
  logger.debug("error{}|{}|{}|{}",ex,cost,exchange.getIn().getHeaders(),exchange.getIn().getBody());
  requestIdManager.clean(exchange);
}