Skip to content
Permalink
Browse files
ARTEMIS-3821 provide readable version of absoluteExpiryTime (and more)
  • Loading branch information
Erwin Dondorp authored and jbertram committed May 23, 2022
1 parent a92e649 commit 14d20895ad113aea1ed1372714f908e4727b3060
Showing 1 changed file with 28 additions and 4 deletions.
@@ -511,15 +511,31 @@ var Artemis;
if (isNaN(type) || typeof type !== "number") {
return type;
}
return type > -1 && type < 8 ? typeLabels[type] : type
return type > -1 && type < typeLabels.length ? typeLabels[type] : type
}

var jmsTypeLabels = ["message", "object", "map", "bytes", "stream", "text"];
function formatJmsType(type) {
if (isNaN(type) || typeof type !== "number") {
return type;
}
return type > -1 && type < jmsTypeLabels.length ? jmsTypeLabels[type] : type
}

var bindingTypeLabels = ["local-queue", "remote-queue", "divert"];
function formatBindingType(type) {
if (isNaN(type) || typeof type !== "number") {
return type;
}
return type > -1 && type < 3 ? bindingTypeLabels[type] : type
return type > -1 && type < bindingTypeLabels.length ? bindingTypeLabels[type] : type
}

var destTypeLabels = ["queue", "topic", "temp-queue", "temp-topic"];
function formatDestType(type) {
if (isNaN(type) || typeof type !== "number") {
return type;
}
return type > -1 && type < destTypeLabels.length ? destTypeLabels[type] : type
}

ctrl.refresh = function() {
@@ -832,15 +848,15 @@ var Artemis;
if (isNaN(enc) || typeof enc !== "number") {
return enc;
}
return enc > -1 && enc < 9 ? amqpEncodingLabels[enc] : enc;
return enc > -1 && enc < amqpEncodingLabels.length ? amqpEncodingLabels[enc] : enc;
}

var routingTypes = ["multicast", "anycast"];
function formatRoutingType(rt) {
if (isNaN(rt) || typeof rt !== "number") {
return enc;
}
return rt > -1 && rt < 2 ? routingTypes[rt] : rt;
return rt > -1 && rt < routingTypes.length ? routingTypes[rt] : rt;
}

function createProperties(message) {
@@ -864,8 +880,16 @@ var Artemis;
v2 += " (" + formatRoutingType(v2) + ")";
} else if(k2 === "extraProperties._AMQ_ACTUAL_EXPIRY") {
v2 += " (" + formatTimestamp(v2) + ")";
} else if(k2 === "messageAnnotations.x-opt-jms-dest") {
v2 += " (" + formatDestType(v2) + ")";
} else if(k2 === "messageAnnotations.x-opt-jms-reply-to") {
v2 += " (" + formatDestType(v2) + ")";
} else if(k2 === "messageAnnotations.x-opt-jms-msg-type") {
v2 += " (" + formatJmsType(v2) + ")";
} else if(k2 === "messageAnnotations.x-opt-ACTUAL-EXPIRY") {
v2 += " (" + formatTimestamp(v2) + ")";
} else if(k2 === "properties.absoluteExpiryTime") {
v2 += " (" + formatTimestamp(v2) + ")";
} else if(k2 === "properties.creationTime") {
v2 += " (" + formatTimestamp(v2) + ")";
} else if(k2 === "__HDR_BROKER_IN_TIME") {

0 comments on commit 14d2089

Please sign in to comment.