From 7b3c185bba90fa50a7b78c1ac2534fe43dd41927 Mon Sep 17 00:00:00 2001 From: Robbie Gemmell Date: Mon, 10 Oct 2022 09:55:03 +0100 Subject: [PATCH] ARTEMIS-4020: restore some gates I had stashed changes to undo removals for --- .../commands/tools/xml/XmlDataImporter.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java index 34768977f1..545cdd7968 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataImporter.java @@ -248,7 +248,10 @@ public final class XmlDataImporter extends ActionAbstract { } try { while (reader.hasNext()) { - logger.debug("EVENT:[{}][{}] ", reader.getLocation().getLineNumber(), reader.getLocation().getColumnNumber()); + if (logger.isDebugEnabled()) { + logger.debug("EVENT:[{}][{}] ", reader.getLocation().getLineNumber(), reader.getLocation().getColumnNumber()); + } + if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) { if (XmlDataConstants.OLD_BINDING.equals(reader.getLocalName())) { oldBinding(); // export from 1.x @@ -313,13 +316,17 @@ public final class XmlDataImporter extends ActionAbstract { ClientMessage managementMessage = managementSession.createMessage(false); ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queue, "ID"); managementSession.start(); - logger.debug("Requesting ID for: {}", queue); + if (debugLog) { + logger.debug("Requesting ID for: {}", queue); + } ClientMessage reply = requestor.request(managementMessage); Number idObject = (Number) ManagementHelper.getResult(reply); queueID = idObject.longValue(); } - logger.debug("ID for {} is: {}", queue, queueID); + if (debugLog) { + logger.debug("ID for {} is: {}", queue, queueID); + } queueIDs.put(queue, queueID); // store it so we don't have to look it up every time } @@ -419,7 +426,9 @@ public final class XmlDataImporter extends ActionAbstract { if (!queueQuery.isExists()) { session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter)); - logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter); + if (logger.isDebugEnabled()) { + logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter); + } } else { logger.debug("Binding {} already exists so won't re-bind.", queueName); } @@ -457,7 +466,9 @@ public final class XmlDataImporter extends ActionAbstract { if (!queueQuery.isExists()) { session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(RoutingType.valueOf(routingType)).setFilterString(filter)); - logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter); + if (logger.isDebugEnabled()) { + logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter); + } } else { logger.debug("Binding {} already exists so won't re-bind.", queueName); }