{
object.put("id", message.getMessageNumber());
object.put("arrivalTime",message.getArrivalTime());
object.put("persistent", message.isPersistent());
final AMQMessageHeader messageHeader = message.getMessageHeader();
if(messageHeader != null)
{
addIfPresent(object, "messageId", messageHeader.getMessageId());
addIfPresent(object, "expirationTime", messageHeader.getExpiration());
addIfPresent(object, "applicationId", messageHeader.getAppId());
addIfPresent(object, "correlationId", messageHeader.getCorrelationId());
addIfPresent(object, "encoding", messageHeader.getEncoding());
addIfPresent(object, "mimeType", messageHeader.getMimeType());
addIfPresent(object, "priority", messageHeader.getPriority());
addIfPresent(object, "replyTo", messageHeader.getReplyTo());
addIfPresent(object, "timestamp", messageHeader.getTimestamp());
addIfPresent(object, "type", messageHeader.getType());
addIfPresent(object, "userId", messageHeader.getUserId());
}
}