From ca80662fd0e54e3699b736ad92418e8b1c048e87 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 21 May 2019 10:54:12 +0100 Subject: [PATCH] ARTEMIS-2346 - make timestamp human readable in console https://issues.apache.org/jira/browse/ARTEMIS-2346 --- .../core/management/impl/openmbean/OpenTypeSupport.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java index 48cc2eacae..6c7a9b5a45 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java @@ -26,6 +26,8 @@ import javax.management.openmbean.SimpleType; import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularType; import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -105,7 +107,7 @@ public final class OpenTypeSupport { addItem(CompositeDataConstants.EXPIRATION, CompositeDataConstants.EXPIRATION_DESCRIPTION, SimpleType.LONG); addItem(CompositeDataConstants.PRIORITY, CompositeDataConstants.PRIORITY_DESCRIPTION, SimpleType.BYTE); addItem(CompositeDataConstants.REDELIVERED, CompositeDataConstants.REDELIVERED_DESCRIPTION, SimpleType.BOOLEAN); - addItem(CompositeDataConstants.TIMESTAMP, CompositeDataConstants.TIMESTAMP_DESCRIPTION, SimpleType.DATE); + addItem(CompositeDataConstants.TIMESTAMP, CompositeDataConstants.TIMESTAMP_DESCRIPTION, SimpleType.STRING); addItem(CompositeDataConstants.PROPERTIES, CompositeDataConstants.PROPERTIES_DESCRIPTION, SimpleType.STRING); @@ -142,7 +144,8 @@ public final class OpenTypeSupport { rc.put(CompositeDataConstants.TYPE, m.getType()); rc.put(CompositeDataConstants.DURABLE, m.isDurable()); rc.put(CompositeDataConstants.EXPIRATION, m.getExpiration()); - rc.put(CompositeDataConstants.TIMESTAMP, new Date(m.getTimestamp())); + DateFormat dateFormat = new SimpleDateFormat(); + rc.put(CompositeDataConstants.TIMESTAMP, dateFormat.format(new Date(m.getTimestamp()))); rc.put(CompositeDataConstants.PRIORITY, m.getPriority()); rc.put(CompositeDataConstants.REDELIVERED, ref.getDeliveryCount() > 1);