Render a {@link javax.jms.Message}.
if(o instanceof Message) {
StringBuffer sbuf = new StringBuffer();
Message m = (Message) o;
try {
sbuf.append("DeliveryMode=");
switch(m.getJMSDeliveryMode()) {
case DeliveryMode.NON_PERSISTENT :
sbuf.append("NON_PERSISTENT");
break;
case DeliveryMode.PERSISTENT :
sbuf.append("PERSISTENT");
break;
default: sbuf.append("UNKNOWN");
}
sbuf.append(", CorrelationID=");
sbuf.append(m.getJMSCorrelationID());
sbuf.append(", Destination=");
sbuf.append(m.getJMSDestination());
sbuf.append(", Expiration=");
sbuf.append(m.getJMSExpiration());
sbuf.append(", MessageID=");
sbuf.append(m.getJMSMessageID());
sbuf.append(", Priority=");
sbuf.append(m.getJMSPriority());
sbuf.append(", Redelivered=");
sbuf.append(m.getJMSRedelivered());
sbuf.append(", ReplyTo=");
sbuf.append(m.getJMSReplyTo());
sbuf.append(", Timestamp=");
sbuf.append(m.getJMSTimestamp());
sbuf.append(", Type=");
sbuf.append(m.getJMSType());
//Enumeration enum = m.getPropertyNames();
//while(enum.hasMoreElements()) {
// String key = (String) enum.nextElement();
// sbuf.append("; "+key+"=");
// sbuf.append(m.getStringProperty(key));
//}
} catch(JMSException e) {
LogLog.error("Could not parse Message.", e);
}
return sbuf.toString();
} else {
return o.toString();
}