return prepend + "[Body is file based: " + obj + "]";
}
}
// is the body a stream cache
StreamCache cache;
if (obj instanceof StreamCache) {
cache = (StreamCache)obj;
} else {
cache = null;
}
// grab the message body as a string
String body = null;
if (message.getExchange() != null) {
try {
body = message.getExchange().getContext().getTypeConverter().convertTo(String.class, message.getExchange(), obj);
} catch (Exception e) {
// ignore as the body is for logging purpose
}
}
if (body == null) {
body = obj.toString();
}
// reset stream cache after use
if (cache != null) {
cache.reset();
}
if (body == null) {
return prepend + "[Body is null]";
}