public boolean process()

in camel/src/main/java/org/apache/karaf/webconsole/camel/internal/tracking/TraceProcessor.java [40:79]


    public boolean process(Exchange exchange, AsyncCallback callback) {

        CamelContext context = exchange.getContext();
        if (!context.isTracing()) {
            return super.process(exchange, callback);
        }

        properties.put("exchangeId", exchange.getExchangeId());

        properties.put("exchangeProperties", (Serializable) exchange.getProperties());
        Message msg = exchange.getIn();
        if (msg != null) {
            properties.put("exchangeInId", msg.getMessageId());
            properties.put("exchangeInHeaders", new HashMap<String, Object>(msg.getHeaders()));
            Object body = msg.getBody();
            if (body instanceof Serializable) {
                properties.put("exchangeInBody", (Serializable) body);
            } else {
                properties.put("exchangeInBody", "- not serializable -");
            }
        } else {
            properties.put("exchangeInId", null);
        }

        msg = exchange.getOut();
        if (msg != null) {
            properties.put("exchangeOutId", msg.getMessageId());
            properties.put("exchangeOutHeaders", new HashMap<String, Object>(msg.getHeaders()));
            Object body = msg.getBody();
            if (body instanceof Serializable) {
                properties.put("exchangeOutBody", (Serializable) body);
            } else {
                properties.put("exchangeOutBody", "- not serializable -");
            }
        } else {
            properties.put("exchangeOutId", null);
        }

        return super.process(exchange, callback);
    }