events = backlogTracer.dumpTracedMessages(pattern);
} else {
events = backlogTracer.dumpAllTracedMessages();
}
for (BacklogTracerEventMessage event : events) {
MessageDump msg = (MessageDump) unmarshaller.unmarshal(new StringReader(event.getMessageAsXml()));
String breadcrumb = getBreadcrumbId(msg.getHeaders());
System.out.println("#" + event.getUid() + "\tTimestamp:\t" + sdf.format(event.getTimestamp()));
if (breadcrumb != null) {
System.out.println("Breadcrumb: " + breadcrumb);
}
System.out.println("ExchangeId: " + event.getExchangeId());
if (event.getToNode() != null) {
System.out.println("Route: " + event.getRouteId() + "\t--> " + event.getToNode());
} else {
System.out.println("Route: " + event.getRouteId());
}
String body = msg.getBody().getValue();
if (bodySize != null && bodySize > 0) {
if (body.length() > bodySize) {
body = body.substring(0, bodySize);
}
}