protected void loggerTheMessage(Message message, String messageTile) {
StringBuffer buffer = new StringBuffer(messageTile + "\n"
+ "--------------------------------------");
InputStream is = message.getContent(InputStream.class);
if (is != null) {
CachedOutputStream bos = new CachedOutputStream();
try {
IOUtils.copy(is, bos);
is.close();
bos.close();
buffer.append("\nMessage:\n");
buffer.append(bos.getOut().toString());
message.setContent(InputStream.class, bos.getInputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
buffer.append("\n--------------------------------------");