ARTEMIS-4020: switch to using SLF4J API for logging, use Log4J 2 as impl for broker distribution and tests

PR includes work from myself and Clebert Suconic, squashed from the new-logging branch.
This commit is contained in:
Robbie Gemmell 2022-09-28 12:18:59 +01:00 committed by clebertsuconic
parent 1a8c458906
commit 9873fccf74
743 changed files with 10274 additions and 12640 deletions

View File

@ -116,12 +116,6 @@ public class Artemis {
System.setProperty("java.io.tmpdir", new File(fileInstance, "tmp").getCanonicalPath());
}
// Lets try to covert the logging.configuration setting to a valid URI
String loggingConfig = System.getProperty("logging.configuration");
if (loggingConfig != null) {
System.setProperty("logging.configuration", fixupFileURI(loggingConfig));
}
ClassLoader originalCL = Thread.currentThread().getContextClassLoader();
// Now setup our classloader..
@ -140,14 +134,6 @@ public class Artemis {
}
static String fixupFileURI(String value) {
if (value != null && value.startsWith("file:")) {
value = value.substring("file:".length());
value = new File(value).toURI().toString();
}
return value;
}
private static void add(ArrayList<URL> urls, File file) {
try {
urls.add(file.toURI().toURL());

View File

@ -35,29 +35,21 @@
<name>ActiveMQ Artemis CDI Integration</name>
<dependencies>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
@ -112,6 +104,12 @@
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-unit-test-support</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>

View File

@ -21,44 +21,27 @@ package org.apache.artemis.client.cdi.logger;
import javax.enterprise.inject.spi.ProcessBean;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.LogMessage;
import org.apache.activemq.artemis.logs.BundleFactory;
/**
* Logger code 57
*
* each message id must be 6 digits long starting with 57, the 3rd digit donates the level so
*
* INF0 1
* WARN 2
* DEBUG 3
* ERROR 4
* TRACE 5
* FATAL 6
*
* so an INFO message would be 571000 to 571999
*/
@MessageLogger(projectCode = "AMQ")
public interface ActiveMQCDILogger extends BasicLogger {
@LogBundle(projectCode = "AMQ", regexID = "57[0-9]{4}")
public interface ActiveMQCDILogger {
ActiveMQCDILogger LOGGER = Logger.getMessageLogger(ActiveMQCDILogger.class, ActiveMQCDILogger.class.getPackage().getName());
ActiveMQCDILogger LOGGER = BundleFactory.newBundle(ActiveMQCDILogger.class, ActiveMQCDILogger.class.getPackage().getName());
@LogMessage
@Message(id = 571000, value = "Discovered configuration class {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 571000, value = "Discovered configuration class {}", level = LogMessage.Level.INFO)
void discoveredConfiguration(ProcessBean<?> pb);
@LogMessage
@Message(id = 571001, value = "Discovered client configuration class {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 571001, value = "Discovered client configuration class {}", level = LogMessage.Level.INFO)
void discoveredClientConfiguration(ProcessBean<?> pb);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 573000, value = "Configuration found, not using built in configuration")
@LogMessage(id = 573000, value = "Configuration found, not using built in configuration", level = LogMessage.Level.DEBUG)
void notUsingDefaultConfiguration();
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 573001, value = "Configuration found, not using built in configuration")
@LogMessage(id = 573001, value = "Configuration found, not using built in configuration", level = LogMessage.Level.DEBUG)
void notUsingDefaultClientConfiguration();
}

View File

@ -82,22 +82,23 @@
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-jms-client</artifactId>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>airline</artifactId>

View File

@ -71,6 +71,8 @@ import org.apache.activemq.artemis.cli.commands.user.HelpUser;
import org.apache.activemq.artemis.cli.commands.user.ListUser;
import org.apache.activemq.artemis.cli.commands.user.RemoveUser;
import org.apache.activemq.artemis.cli.commands.user.ResetUser;
import org.apache.activemq.artemis.dto.ManagementContextDTO;
import org.apache.activemq.artemis.dto.XmlUtil;
/**
* Artemis is the main CLI entry point for managing/running a broker.
@ -79,6 +81,9 @@ import org.apache.activemq.artemis.cli.commands.user.ResetUser;
* run. Make sure set the -Dartemis.instance=path/to/instance system property.
* You should also use the 'apache-artemis' module for the class path since that
* includes all artemis modules.
*
* Notice that this class should not use any logging as it's part of the bootstrap and using logging here could
* disrupt the order of bootstrapping on certain components (e.g. JMX being started from log4j)
*/
public class Artemis {
@ -88,9 +93,31 @@ public class Artemis {
String instance = System.getProperty("artemis.instance");
File fileInstance = instance != null ? new File(instance) : null;
verifyManagementDTO(fileInstance);
execute(true, true, fileHome, fileInstance, args);
}
// Notice this has to happen before any Log4j is used.
// otherwise Log4j's JMX will start the JMX before this property was able to tbe set
public static void verifyManagementDTO(File fileInstance) {
if (fileInstance != null) {
File etc = new File(fileInstance, "etc");
File management = new File(etc, "management.xml");
try {
ManagementContextDTO managementContextDTO = XmlUtil.decode(ManagementContextDTO.class, management);
if (managementContextDTO != null && managementContextDTO.getAuthorisation() != null) {
System.setProperty("javax.management.builder.initial", "org.apache.activemq.artemis.core.server.management.ArtemisMBeanServerBuilder");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
public static Object internalExecute(String... args) throws Exception {
return internalExecute(null, null, args);
}
@ -101,6 +128,8 @@ public class Artemis {
public static Object execute(boolean inputEnabled, boolean useSystemOut, File artemisHome, File artemisInstance, String... args) throws Exception {
verifyManagementDTO(artemisInstance);
if (inputEnabled) {
InputAbstract.enableInput();
}

View File

@ -33,14 +33,17 @@ import org.apache.activemq.artemis.core.config.FileDeploymentManager;
import org.apache.activemq.artemis.core.config.impl.FileConfiguration;
import org.apache.activemq.artemis.dto.BrokerDTO;
import org.apache.activemq.artemis.dto.ManagementContextDTO;
import org.apache.activemq.artemis.integration.bootstrap.ActiveMQBootstrapLogger;
import org.apache.activemq.artemis.jms.server.config.impl.FileJMSConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Abstract class where we can replace the configuration in various places *
*/
public abstract class Configurable extends ActionAbstract {
private static final Logger logger = LoggerFactory.getLogger(Configurable.class);
@Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'")
String configuration;
@ -55,7 +58,7 @@ public abstract class Configurable extends ActionAbstract {
private FileConfiguration fileConfiguration;
protected void treatError(Exception e, String group, String command) {
ActiveMQBootstrapLogger.LOGGER.debug(e.getMessage(), e);
logger.debug(e.getMessage(), e);
System.err.println();
System.err.println("Error:" + e.getMessage());
System.err.println();
@ -142,7 +145,7 @@ public abstract class Configurable extends ActionAbstract {
// To support Windows paths as explained above.
configuration = configuration.replace("\\", "/");
ActiveMQBootstrapLogger.LOGGER.usingBrokerConfig(configuration);
logger.debug("Using broker configuration: {}", configuration);
}
return configuration;

View File

@ -21,7 +21,6 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@ -82,7 +81,7 @@ public class Create extends InputAbstract {
public static final String BIN_ARTEMIS = "bin/artemis";
public static final String BIN_ARTEMIS_SERVICE = "bin/artemis-service";
public static final String ETC_ARTEMIS_PROFILE = "artemis.profile";
public static final String ETC_LOGGING_PROPERTIES = "logging.properties";
public static final String ETC_LOG4J2_PROPERTIES = "log4j2.properties";
public static final String ETC_BOOTSTRAP_XML = "bootstrap.xml";
public static final String ETC_MANAGEMENT_XML = "management.xml";
public static final String ETC_BROKER_XML = "broker.xml";
@ -770,9 +769,6 @@ public class Create extends InputAbstract {
File dataFolder = createDirectory(data, directory);
filters.put("${artemis.instance.data}", path(dataFolder));
filters.put("${logmanager}", getLogManager());
filters.put("${wildfly-common}", getWildflyCommon());
if (javaOptions == null || javaOptions.length() == 0) {
javaOptions = "";
}
@ -826,7 +822,7 @@ public class Create extends InputAbstract {
writeEtc(ETC_ARTEMIS_PROFILE, etcFolder, filters, true);
}
writeEtc(ETC_LOGGING_PROPERTIES, etcFolder, null, false);
writeEtc(ETC_LOG4J2_PROPERTIES, etcFolder, null, false);
if (noWeb) {
filters.put("${bootstrap-web-settings}", "");
@ -1008,41 +1004,6 @@ public class Create extends InputAbstract {
return count;
}
private String getLogManager() throws IOException {
String logManager = "";
File dir = new File(path(getHome().toString()) + "/lib");
File[] matches = dir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("jboss-logmanager") && name.endsWith(".jar");
}
});
if (matches != null && matches.length > 0) {
logManager = matches[0].getName();
}
return logManager;
}
private String getWildflyCommon() throws IOException {
String logManager = "";
File dir = new File(path(getHome().toString()) + "/lib");
File[] matches = dir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("wildfly-common") && name.endsWith(".jar");
}
});
if (matches != null && matches.length > 0) {
logManager = matches[0].getName();
}
return logManager;
}
/**
* It will create the address and queue configurations
*/

View File

@ -97,7 +97,7 @@ public class Run extends LockAbstract {
}
try {
server.getServer().getManagementService().registerHawtioSecurity(managementContext.getArtemisMBeanServerGuard());
} catch (Exception e) {
} catch (Throwable e) {
ActiveMQServerLogger.LOGGER.unableToDeployHawtioMBean(e);
}
}

View File

@ -40,12 +40,13 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.utils.Base64;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** This is an Utility class that will import the outputs in XML format. */
public class XMLMessageImporter {
private static final Logger logger = Logger.getLogger(XMLMessageImporter.class);
private static final Logger logger = LoggerFactory.getLogger(XMLMessageImporter.class);
private XMLStreamReader reader;

View File

@ -62,13 +62,16 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.codec.CursorAck
import org.apache.activemq.artemis.core.persistence.impl.journal.codec.PageUpdateTXEncoding;
import org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentAddressBindingEncoding;
import org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding;
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.core.server.JournalType;
import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Command(name = "exp", description = "Export all message-data using an XML that could be interpreted by any system.")
public final class XmlDataExporter extends DBOption {
private static final Logger logger = LoggerFactory.getLogger(XmlDataExporter.class);
private XMLStreamWriter xmlWriter;
// an inner map of message refs hashed by the queue ID to which they belong and then hashed by their record ID
@ -149,8 +152,8 @@ public final class XmlDataExporter extends DBOption {
getBindings();
processMessageJournal();
printDataAsXML();
ActiveMQServerLogger.LOGGER.debug("\n\nProcessing took: " + (System.currentTimeMillis() - start) + "ms");
ActiveMQServerLogger.LOGGER.debug("Output " + messagesPrinted + " messages and " + bindingsPrinted + " bindings.");
logger.debug("\n\nProcessing took: {}ms", (System.currentTimeMillis() - start));
logger.debug("Output {} messages and {} bindings.", messagesPrinted, bindingsPrinted);
}
/**
@ -169,7 +172,7 @@ public final class XmlDataExporter extends DBOption {
Journal messageJournal = storageManager.getMessageJournal();
ActiveMQServerLogger.LOGGER.debug("Reading journal from " + config.getJournalDirectory());
logger.debug("Reading journal from {}", config.getJournalDirectory());
messageJournal.start();
@ -201,7 +204,7 @@ public final class XmlDataExporter extends DBOption {
}
}
ActiveMQServerLogger.LOGGER.debug(message.toString());
logger.debug(message.toString());
}
};
@ -299,7 +302,7 @@ public final class XmlDataExporter extends DBOption {
bindingsJournal.start();
ActiveMQServerLogger.LOGGER.debug("Reading bindings journal from " + config.getBindingsDirectory());
logger.debug("Reading bindings journal from {}", config.getBindingsDirectory());
bindingsJournal.load(records, null, null);
@ -396,11 +399,11 @@ public final class XmlDataExporter extends DBOption {
if (pageStore != null) {
File folder = pageStore.getFolder();
ActiveMQServerLogger.LOGGER.debug("Reading page store " + store + " folder = " + folder);
logger.debug("Reading page store {} folder = {}", store, folder);
long pageId = pageStore.getFirstPage();
for (long i = 0; i < pageStore.getNumberOfPages(); i++) {
ActiveMQServerLogger.LOGGER.debug("Reading page " + pageId);
logger.debug("Reading page {}", pageId);
Page page = pageStore.newPageObject(pageId);
page.open(false);
org.apache.activemq.artemis.utils.collections.LinkedList<PagedMessage> messages = page.read(storageManager);
@ -445,7 +448,7 @@ public final class XmlDataExporter extends DBOption {
}
}
} else {
ActiveMQServerLogger.LOGGER.debug("Page store was null");
logger.debug("Page store was null");
}
}
} catch (Exception e) {

View File

@ -63,7 +63,8 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
import org.apache.activemq.artemis.utils.ClassloadingUtil;
import org.apache.activemq.artemis.utils.ListUtil;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Read XML output from <code>org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataExporter</code>, create a core session, and
@ -73,7 +74,7 @@ import org.jboss.logging.Logger;
@Command(name = "imp", description = "Import all message-data using an XML that could be interpreted by any system.")
public final class XmlDataImporter extends ActionAbstract {
private static final Logger logger = Logger.getLogger(XmlDataImporter.class);
private static final Logger logger = LoggerFactory.getLogger(XmlDataImporter.class);
private XMLStreamReader reader;

View File

@ -16,68 +16,30 @@
*/
package org.apache.activemq.artemis.integration.bootstrap;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.LogMessage;
import org.apache.activemq.artemis.logs.BundleFactory;
/**
* Logger Code 10
*
* each message id must be 6 digits long starting with 10, the 3rd digit donates the level so
*
* INF0 1
* WARN 2
* DEBUG 3
* ERROR 4
* TRACE 5
* FATAL 6
*
* so an INFO message would be 101000 to 101999
*/
@MessageLogger(projectCode = "AMQ")
public interface ActiveMQBootstrapLogger extends BasicLogger {
@LogBundle(projectCode = "AMQ", regexID = "10[0-9]{4}")
public interface ActiveMQBootstrapLogger {
/**
* The default logger.
*/
ActiveMQBootstrapLogger LOGGER = Logger.getMessageLogger(ActiveMQBootstrapLogger.class, ActiveMQBootstrapLogger.class.getPackage().getName());
ActiveMQBootstrapLogger LOGGER = BundleFactory.newBundle(ActiveMQBootstrapLogger.class, ActiveMQBootstrapLogger.class.getPackage().getName());
@LogMessage(level = Logger.Level.INFO)
@Message(id = 101000, value = "Starting ActiveMQ Artemis Server", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 101000, value = "Starting ActiveMQ Artemis Server", level = LogMessage.Level.INFO)
void serverStarting();
@LogMessage(level = Logger.Level.INFO)
@Message(id = 101001, value = "Stopping ActiveMQ Artemis Server", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 101001, value = "Stopping ActiveMQ Artemis Server", level = LogMessage.Level.INFO)
void serverStopping();
@LogMessage(level = Logger.Level.INFO)
@Message(id = 101002, value = "Starting Naming server on {0}:{1,number,#} (rmi {2}:{3,number,#})", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 101002, value = "Starting Naming server on {}:{} (rmi {}:{})", level = LogMessage.Level.INFO)
void startedNamingService(String bindAddress, int port, String rmiBindAddress, int rmiPort);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 101003, value = "Halting ActiveMQ Artemis Server after user request", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 101003, value = "Halting ActiveMQ Artemis Server after user request", level = LogMessage.Level.INFO)
void serverKilled();
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 101005, value = "Using broker configuration: {0}", format = Message.Format.MESSAGE_FORMAT)
void usingBrokerConfig(String location);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 102000, value = "Error during undeployment: {0}", format = Message.Format.MESSAGE_FORMAT)
void errorDuringUndeployment(@Cause Throwable t, String name);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 104000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 104000, value = "Failed to delete file {}", level = LogMessage.Level.ERROR)
void errorDeletingFile(String name);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 104001, value = "Failed to start server", format = Message.Format.MESSAGE_FORMAT)
void errorStartingServer(@Cause Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 104002, value = "The print data operation failed: {0}", format = Message.Format.MESSAGE_FORMAT)
void printDataFailed(String exceptionMessage);
}

View File

@ -50,10 +50,6 @@ HAWTIO_ROLE="NO_HAWTIO_ROLE"
ARTEMIS_INSTANCE_ETC='${artemis.instance.etc}'
. "$ARTEMIS_INSTANCE_ETC/artemis.profile"
# Set Defaults Properties
ARTEMIS_LOGGING_CONF="$ARTEMIS_INSTANCE_ETC_URI/logging.properties"
ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager
CLASSPATH="$ARTEMIS_HOME/lib/artemis-boot.jar"
@ -99,21 +95,6 @@ if $cygwin ; then
CLASSPATH=`cygpath --windows "$CLASSPATH"`
fi
# finding the Log Manager
LOG_MANAGER=`ls $ARTEMIS_HOME/lib/jboss-logmanager*jar 2>/dev/null`
if [ -z "$LOG_MANAGER" ] ; then
# this is the one found when the server was created
LOG_MANAGER="$ARTEMIS_HOME/lib/${logmanager}"
fi
WILDFLY_COMMON=`ls $ARTEMIS_HOME/lib/wildfly-common*jar 2>/dev/null`
if [ -z "$WILDFLY_COMMON" ] ; then
# this is the one found when the server was created
WILDFLY_COMMON="$ARTEMIS_HOME/lib/${wildfly-common}"
fi
if [ -f "$ARTEMIS_OOME_DUMP" ] ; then
# backup the last OOME heap dump
mv $ARTEMIS_OOME_DUMP $ARTEMIS_OOME_DUMP.bkp
@ -122,7 +103,6 @@ fi
exec "$JAVACMD" \
$JAVA_ARGS \
-Dhawtio.role="$HAWTIO_ROLE" \
-Xbootclasspath/a:"$LOG_MANAGER:$WILDFLY_COMMON" \
-Djava.security.auth.login.config="$ARTEMIS_INSTANCE_ETC/login.config" \
$ARTEMIS_CLUSTER_PROPS \
-classpath "$CLASSPATH" \
@ -132,8 +112,6 @@ exec "$JAVACMD" \
-Djava.io.tmpdir="$ARTEMIS_INSTANCE/tmp" \
-Ddata.dir="$ARTEMIS_DATA_DIR" \
-Dartemis.instance.etc="$ARTEMIS_INSTANCE_ETC" \
-Djava.util.logging.manager="$ARTEMIS_LOG_MANAGER" \
-Dlogging.configuration="$ARTEMIS_LOGGING_CONF" \
-Dartemis.default.sensitive.string.codec.key="$ARTEMIS_DEFAULT_SENSITIVE_STRING_CODEC_KEY" \
$DEBUG_ARGS \
org.apache.activemq.artemis.boot.Artemis "$@"

View File

@ -33,7 +33,6 @@
<logmode>roll</logmode>
<executable>%JAVA_HOME%\bin\java.exe</executable>
<startargument>-Xbootclasspath/a:%ARTEMIS_HOME%\lib\${logmanager};%ARTEMIS_HOME%\lib\${wildfly-common}</startargument>
<startargument>-XX:+UseParallelGC</startargument>
<startargument>-Xms512M</startargument>
<startargument>-Xmx1024M</startargument>
@ -51,8 +50,6 @@
<startargument>-Dartemis.instance=%ARTEMIS_INSTANCE%</startargument>
<startargument>-Ddata.dir=%ARTEMIS_DATA_DIR%</startargument>
<startargument>-Dartemis.instance.etc=%ARTEMIS_INSTANCE_ETC%</startargument>
<startargument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</startargument>
<startargument>-Dlogging.configuration=%ARTEMIS_INSTANCE_ETC_URI%/logging.properties</startargument>
<startargument>-Djava.security.auth.login.config=%ARTEMIS_INSTANCE_ETC%\login.config</startargument>
<startargument>-Dhawtio.disableProxy=true</startargument>
<startargument>-Dhawtio.realm=activemq</startargument>
@ -70,7 +67,6 @@
<startargument>run</startargument>
<stopexecutable>%JAVA_HOME%\bin\java.exe</stopexecutable>
<stopargument>-Xbootclasspath/a:%ARTEMIS_HOME%\lib\${logmanager};%ARTEMIS_HOME%\lib\${wildfly-common}</stopargument>
<stopargument>-XX:+UseParallelGC</stopargument>
<stopargument>-Xms512M</stopargument>
<stopargument>-Xmx1024M</stopargument>
@ -81,8 +77,6 @@
<stopargument>-Dartemis.instance=%ARTEMIS_INSTANCE%</stopargument>
<stopargument>-Ddata.dir=%ARTEMIS_DATA_DIR%</stopargument>
<stopargument>-Dartemis.instance.etc="%ARTEMIS_INSTANCE_ETC%"</stopargument>
<stopargument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</stopargument>
<stopargument>-Dlogging.configuration=%ARTEMIS_INSTANCE_ETC_URI%/logging.properties</stopargument>
<stopargument>org.apache.activemq.artemis.boot.Artemis</stopargument>

View File

@ -48,10 +48,6 @@ rem "Load Profile Config"
set ARTEMIS_INSTANCE_ETC="${artemis.instance.etc}"
call %ARTEMIS_INSTANCE_ETC%\artemis.profile.cmd %*
rem "Set Defaults."
set ARTEMIS_LOGGING_CONF=%ARTEMIS_INSTANCE_ETC_URI%/logging.properties
set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager
if not exist "%ARTEMIS_OOME_DUMP%" goto NO_ARTEMIS_OOME_DUMP
rem "Backup the last OOME heap dump"
move /Y "%ARTEMIS_OOME_DUMP%" "%ARTEMIS_OOME_DUMP%.bkp"
@ -66,8 +62,6 @@ set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance=%ARTEMIS_INSTANCE%
set JVM_ARGS=%JVM_ARGS% -Ddata.dir=%ARTEMIS_DATA_DIR%
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance.etc=%ARTEMIS_INSTANCE_ETC%
set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager=%ARTEMIS_LOG_MANAGER%
set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration=%ARTEMIS_LOGGING_CONF%
set JVM_ARGS=%JVM_ARGS% -Dartemis.default.sensitive.string.codec.key=%ARTEMIS_DEFAULT_SENSITIVE_STRING_CODEC_KEY%
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%

View File

@ -33,7 +33,7 @@ rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446
rem Java Opts
IF "%JAVA_ARGS%"=="" (set JAVA_ARGS=${java-opts} -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Xbootclasspath/a:%ARTEMIS_HOME%\lib\${logmanager};%ARTEMIS_HOME%\lib\${wildfly-common} -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=${role} -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)
IF "%JAVA_ARGS%"=="" (set JAVA_ARGS=${java-opts} -XX:AutoBoxCacheMax=20000 -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx${java-memory} -Djava.security.auth.login.config=%ARTEMIS_ETC_DIR%\login.config -Dhawtio.disableProxy=true -Dhawtio.offline=true -Dhawtio.realm=activemq -Dhawtio.role=${role} -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=%ARTEMIS_INSTANCE_ETC_URI%\jolokia-access.xml -Dartemis.instance=%ARTEMIS_INSTANCE%)
rem Logs Safepoints JVM pauses: Uncomment to enable them
rem In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could

View File

@ -0,0 +1,92 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Log4J 2 configuration
# Monitor config file every X seconds for updates
monitorInterval = 5
rootLogger = INFO, console, log_file
logger.activemq.name=org.apache.activemq
logger.activemq.level=INFO
logger.artemis_server.name=org.apache.activemq.artemis.core.server
logger.artemis_server.level=INFO
logger.artemis_journal.name=org.apache.activemq.artemis.journal
logger.artemis_journal.level=INFO
logger.artemis_utils.name=org.apache.activemq.artemis.utils
logger.artemis_utils.level=INFO
# CriticalAnalyzer: If you have issues with the CriticalAnalyzer, setting this to TRACE would give
# you extra troubleshooting info, but do not use TRACE regularly as it would incur extra CPU usage.
logger.critical_analyzer.name=org.apache.activemq.artemis.utils.critical
logger.critical_analyzer.level=INFO
# Audit loggers: to enable change levels from OFF to INFO
logger.audit_base = OFF, audit_log_file
logger.audit_base.name = org.apache.activemq.audit.base
logger.audit_base.additivity = false
logger.audit_resource = OFF, audit_log_file
logger.audit_resource.name = org.apache.activemq.audit.resource
logger.audit_resource.additivity = false
logger.audit_message = OFF, audit_log_file
logger.audit_message.name = org.apache.activemq.audit.message
logger.audit_message.additivity = false
# Jetty logger levels
logger.jetty.name=org.eclipse.jetty
logger.jetty.level=WARN
# Quorum related logger levels
logger.curator.name=org.apache.curator
logger.curator.level=WARN
logger.zookeeper.name=org.apache.zookeeper
logger.zookeeper.level=ERROR
# Console appender
appender.console.type=Console
appender.console.name=console
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%d %-5level [%logger] %msg%n
# Log file appender
appender.log_file.type = RollingFile
appender.log_file.name = log_file
appender.log_file.fileName = ${sys:artemis.instance}/log/artemis.log
appender.log_file.filePattern = ${sys:artemis.instance}/log/artemis.log.%d{yyyy-MM-dd}
appender.log_file.layout.type = PatternLayout
appender.log_file.layout.pattern = %d %-5level [%logger] %msg%n
appender.log_file.policies.type = Policies
appender.log_file.policies.cron.type = CronTriggeringPolicy
appender.log_file.policies.cron.schedule = 0 0 0 * * ?
appender.log_file.policies.cron.evaluateOnStartup = true
# Audit log file appender
appender.audit_log_file.type = RollingFile
appender.audit_log_file.name = audit_log_file
appender.audit_log_file.fileName = ${sys:artemis.instance}/log/audit.log
appender.audit_log_file.filePattern = ${sys:artemis.instance}/log/audit.log.%d{yyyy-MM-dd}
appender.audit_log_file.layout.type = PatternLayout
appender.audit_log_file.layout.pattern = %d [AUDIT](%t) %msg%n
appender.audit_log_file.policies.type = Policies
appender.audit_log_file.policies.cron.type = CronTriggeringPolicy
appender.audit_log_file.policies.cron.schedule = 0 0 0 * * ?
appender.audit_log_file.policies.cron.evaluateOnStartup = true

View File

@ -1,90 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Additional logger names to configure (root logger is always configured)
# Root logger option
loggers=org.eclipse.jetty,org.jboss.logging,org.apache.activemq.artemis.core.server,org.apache.activemq.artemis.utils,org.apache.activemq.artemis.utils.critical,org.apache.activemq.artemis.journal,org.apache.activemq.artemis.jms.server,org.apache.activemq.artemis.integration.bootstrap,org.apache.activemq.audit.base,org.apache.activemq.audit.message,org.apache.activemq.audit.resource,org.apache.curator,org.apache.zookeeper
# Root logger level
logger.level=INFO
# ActiveMQ Artemis logger levels
logger.org.apache.activemq.artemis.core.server.level=INFO
logger.org.apache.activemq.artemis.journal.level=INFO
logger.org.apache.activemq.artemis.utils.level=INFO
# if you have issues with CriticalAnalyzer, setting this as TRACE would give you extra troubleshooting information.
# but do not use it regularly as it would incur in some extra CPU usage for this diagnostic.
logger.org.apache.activemq.artemis.utils.critical.level=INFO
logger.org.apache.activemq.artemis.jms.level=INFO
logger.org.apache.activemq.artemis.integration.bootstrap.level=INFO
logger.org.eclipse.jetty.level=WARN
# Root logger handlers
logger.handlers=FILE,CONSOLE
# quorum logger levels
logger.org.apache.curator.level=WARN
logger.org.apache.zookeeper.level=ERROR
# to enable audit change the level to INFO
logger.org.apache.activemq.audit.base.level=ERROR
logger.org.apache.activemq.audit.base.handlers=AUDIT_FILE
logger.org.apache.activemq.audit.base.useParentHandlers=false
logger.org.apache.activemq.audit.resource.level=ERROR
logger.org.apache.activemq.audit.resource.handlers=AUDIT_FILE
logger.org.apache.activemq.audit.resource.useParentHandlers=false
logger.org.apache.activemq.audit.message.level=ERROR
logger.org.apache.activemq.audit.message.handlers=AUDIT_FILE
logger.org.apache.activemq.audit.message.useParentHandlers=false
# Console handler configuration
handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.properties=autoFlush
handler.CONSOLE.level=DEBUG
handler.CONSOLE.autoFlush=true
handler.CONSOLE.formatter=PATTERN
# File handler configuration
handler.FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.FILE.level=DEBUG
handler.FILE.properties=suffix,append,autoFlush,fileName
handler.FILE.suffix=.yyyy-MM-dd
handler.FILE.append=true
handler.FILE.autoFlush=true
handler.FILE.fileName=${artemis.instance}/log/artemis.log
handler.FILE.formatter=PATTERN
# Formatter pattern configuration
formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d %-5p [%c] %s%E%n
#Audit logger
handler.AUDIT_FILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.AUDIT_FILE.level=INFO
handler.AUDIT_FILE.properties=suffix,append,autoFlush,fileName
handler.AUDIT_FILE.suffix=.yyyy-MM-dd
handler.AUDIT_FILE.append=true
handler.AUDIT_FILE.autoFlush=true
handler.AUDIT_FILE.fileName=${artemis.instance}/log/audit.log
handler.AUDIT_FILE.formatter=AUDIT_PATTERN
formatter.AUDIT_PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.AUDIT_PATTERN.properties=pattern
formatter.AUDIT_PATTERN.pattern=%d [AUDIT](%t) %s%E%n

View File

@ -97,11 +97,12 @@ import org.apache.activemq.artemis.utils.Wait;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@ -117,7 +118,7 @@ import static org.junit.Assert.fail;
* Test to validate that the CLI doesn't throw improper exceptions when invoked.
*/
public class ArtemisTest extends CliTestBase {
private static final Logger log = Logger.getLogger(ArtemisTest.class);
private static final Logger log = LoggerFactory.getLogger(ArtemisTest.class);
// some tests will set this, as some security methods will need to know the server the CLI started
private ActiveMQServer server;
@ -168,9 +169,9 @@ public class ArtemisTest extends CliTestBase {
int writes = 2;
int tries = 5;
long totalAvg = SyncCalculation.syncTest(temporaryFolder.getRoot(), 4096, writes, tries, true, true, true, "file.tmp", 1, JournalType.NIO);
log.debug("TotalAvg = " + totalAvg);
log.debug("TotalAvg = {}", totalAvg);
long nanoTime = SyncCalculation.toNanos(totalAvg, writes, false);
log.debug("nanoTime avg = " + nanoTime);
log.debug("nanoTime avg = {}", nanoTime);
assertEquals(0, LibaioContext.getTotalMaxIO());
}
@ -301,7 +302,7 @@ public class ArtemisTest extends CliTestBase {
byte[] contents = Files.readAllBytes(bootstrapFile.toPath());
String cfgText = new String(contents);
log.debug("confg: " + cfgText);
log.debug("confg: {}", cfgText);
config = parseXml(bootstrapFile);
webElem = (Element) config.getElementsByTagName("web").item(0);
@ -447,7 +448,7 @@ public class ArtemisTest extends CliTestBase {
listCmd.execute(context);
String result = context.getStdout();
log.debug("output1:\n" + result);
log.debug("output1:\n{}", result);
//default only one user admin with role amq
assertTrue(result.contains("\"admin\"(amq)"));
@ -466,7 +467,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output2:\n" + result);
log.debug("output2:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertTrue(result.contains("\"guest\"(admin)"));
@ -487,7 +488,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output3:\n" + result);
log.debug("output3:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertTrue(result.contains("\"guest\"(admin)"));
@ -506,13 +507,13 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
addCmd.execute(context);
result = context.getStderr();
assertTrue(result.contains("Failed to add user scott. Reason: AMQ229223: User scott already exists"));
assertTrue("Unexpected output: '" + result + "'", result.contains("Failed to add user scott. Reason: AMQ229223: User scott already exists"));
//check existing users are intact
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output4:\n" + result);
log.debug("output4:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertTrue(result.contains("\"guest\"(admin)"));
@ -529,7 +530,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output5:\n" + result);
log.debug("output5:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertFalse(result.contains("\"guest\"(admin)"));
@ -547,7 +548,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output6:\n" + result);
log.debug("output6:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertFalse(result.contains("\"guest\"(admin)"));
@ -568,7 +569,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output7:\n" + result);
log.debug("output7:\n{}", result);
assertTrue(result.contains("\"admin\"(amq)"));
assertTrue(result.contains("Total: 1"));
@ -583,7 +584,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output8:\n" + result);
log.debug("output8:\n{}", result);
assertTrue(result.contains("Total: 0"));
} finally {
@ -877,7 +878,7 @@ public class ArtemisTest extends CliTestBase {
listCmd.execute(context);
String result = context.getStdout();
log.debug("output1:\n" + result);
log.debug("output1:\n{}", result);
//default only one user admin with role amq
assertTrue(result.contains("\"admin\"(amq)"));
@ -893,7 +894,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output8:\n" + result);
log.debug("output8:\n{}", result);
assertTrue(result.contains("Total: 0"));
@ -926,7 +927,7 @@ public class ArtemisTest extends CliTestBase {
context = new TestActionContext();
listCmd.execute(context);
result = context.getStdout();
log.debug("output2:\n" + result);
log.debug("output2:\n{}", result);
assertTrue(result.contains("Total: 4"));
assertTrue(result.contains("\"guest\"(admin)"));
@ -1007,7 +1008,7 @@ public class ArtemisTest extends CliTestBase {
listCmd.execute(context);
String result = context.getStdout();
log.debug("output1:\n" + result);
log.debug("output1:\n{}", result);
assertTrue(result.contains("Total: 1"));
assertTrue(result.contains("\"admin\"(amq)"));
@ -1037,7 +1038,7 @@ public class ArtemisTest extends CliTestBase {
listCmd.execute(context);
result = context.getStdout();
log.debug("output2:\n" + result);
log.debug("output2:\n{}", result);
// make sure the admin user is still in tact (i.e. that the file wasn't corrupted via concurrent access)
assertTrue(result.contains("\"admin\"(amq)"));
@ -1110,7 +1111,7 @@ public class ArtemisTest extends CliTestBase {
listCmd.execute(context);
String result = context.getStdout();
log.debug("output1:\n" + result);
log.debug("output1:\n{}", result);
assertTrue(result.contains("\"admin\"(" + roleWithSpaces + ")"));
@ -2165,7 +2166,7 @@ public class ArtemisTest extends CliTestBase {
for (String r : roles) {
String storedUsers = (String) roleConfig.getProperty(r);
log.debug("users in role: " + r + " ; " + storedUsers);
log.debug("users in role: {} ; {}", r, storedUsers);
List<String> userList = StringUtil.splitStringList(storedUsers, ",");
assertTrue(userList.contains(user));
}

View File

@ -18,21 +18,22 @@ package org.apache.activemq.cli.test;
import org.apache.activemq.artemis.cli.commands.util.HashUtil;
import org.apache.activemq.artemis.utils.PasswordMaskingUtil;
import org.jboss.logging.Logger;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class HashUtilTest {
private static final Logger log = Logger.getLogger(HashUtilTest.class);
private static final Logger log = LoggerFactory.getLogger(HashUtilTest.class);
@Test
public void testDefaultHashFormat() throws Exception {
final String password = "helloworld";
String hash = HashUtil.tryHash(new TestActionContext(), password);
String hashStr = PasswordMaskingUtil.unwrap(hash);
log.debug("hashString: " + hashStr);
log.debug("hashString: {}", hashStr);
String[] parts = hashStr.split(":");
assertEquals(3, parts.length);
//first part should be able to convert to an int

View File

@ -39,7 +39,7 @@ public class StreamClassPathTest {
testStream(Create.class, Create.BIN_ARTEMIS);
testStream(Create.class, Create.BIN_ARTEMIS_SERVICE);
testStream(Create.class, "etc/" + Create.ETC_ARTEMIS_PROFILE);
testStream(Create.class, "etc/" + Create.ETC_LOGGING_PROPERTIES);
testStream(Create.class, "etc/" + Create.ETC_LOG4J2_PROPERTIES);
testStream(Create.class, "etc/" + Create.ETC_BOOTSTRAP_XML);
testStream(Create.class, "etc/" + Create.ETC_MANAGEMENT_XML);
testStream(Create.class, "etc/" + Create.ETC_BROKER_XML);

View File

@ -51,34 +51,26 @@
</dependency>
<!-- ^^ these dependencies are shaded on this JAR -->
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<!-- Superfluous, except for osgi manifest handling -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<!-- License: MIT -->
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>

View File

@ -28,14 +28,15 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is for components with a scheduled at a fixed rate.
*/
public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, Runnable {
private static final Logger logger = Logger.getLogger(ActiveMQScheduledComponent.class);
private static final Logger logger = LoggerFactory.getLogger(ActiveMQScheduledComponent.class);
protected ScheduledExecutorService scheduledExecutorService;
private boolean startedOwnScheduler;
@ -165,7 +166,7 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R
final AtomicBoolean booked = this.bookedForRunning;
future = scheduledExecutorService.scheduleWithFixedDelay(() -> runForScheduler(booked), initialDelay >= 0 ? initialDelay : period, period, timeUnit);
} else {
logger.tracef("did not start scheduled executor on %s because period was configured as %d", this, period);
logger.trace("did not start scheduled executor on {} because period was configured as {}", this, period);
}
}

View File

@ -35,7 +35,8 @@ import org.apache.activemq.artemis.logs.ActiveMQUtilLogger;
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.apache.activemq.artemis.utils.Env;
import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This will use {@link InetAddress#isReachable(int)} to determine if the network is alive.
@ -43,7 +44,7 @@ import org.jboss.logging.Logger;
*/
public class NetworkHealthCheck extends ActiveMQScheduledComponent {
private static final Logger logger = Logger.getLogger(NetworkHealthCheck.class);
private static final Logger logger = LoggerFactory.getLogger(NetworkHealthCheck.class);
private final Set<ActiveMQComponent> componentList = new ConcurrentHashSet<>();
private final Set<String> addresses = new ConcurrentHashSet<>();
@ -87,7 +88,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
netToUse = null;
}
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.failedToSetNIC(e, nicName);
ActiveMQUtilLogger.LOGGER.failedToSetNIC(nicName, e);
netToUse = null;
}
@ -130,7 +131,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
String strAddress = address.trim();
this.addAddress(strAddress);
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.failedToParseAddressList(e, addressList);
ActiveMQUtilLogger.LOGGER.failedToParseAddressList(addressList, e);
}
}
}
@ -148,7 +149,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
try {
this.addURL(new URL(address.trim()));
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.failedToParseUrlList(e, addressList);
ActiveMQUtilLogger.LOGGER.failedToParseUrlList(addressList, e);
}
}
}
@ -288,7 +289,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
ActiveMQUtilLogger.LOGGER.startingService(component.toString());
component.start();
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.errorStartingComponent(e, component.toString());
ActiveMQUtilLogger.LOGGER.errorStartingComponent(component.toString(), e);
}
}
ownShutdown = false;
@ -301,7 +302,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
ActiveMQUtilLogger.LOGGER.stoppingService(component.toString());
component.stop();
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.errorStoppingComponent(e, component.toString());
ActiveMQUtilLogger.LOGGER.errorStoppingComponent(component.toString(), e);
}
}
}
@ -350,7 +351,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
return null;
}
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.failedToCheckAddress(e, straddress);
ActiveMQUtilLogger.LOGGER.failedToCheckAddress(straddress, e);
return null;
}
}
@ -358,7 +359,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
public boolean check(InetAddress address) throws IOException, InterruptedException {
if (!hasCustomPingCommand() && isReachable(address)) {
if (logger.isTraceEnabled()) {
logger.tracef(address + " OK");
logger.trace(address + " OK");
}
return true;
} else {
@ -432,7 +433,7 @@ public class NetworkHealthCheck extends ActiveMQScheduledComponent {
is.close();
return true;
} catch (Exception e) {
ActiveMQUtilLogger.LOGGER.failedToCheckURL(e, url.toString());
ActiveMQUtilLogger.LOGGER.failedToCheckURL(url.toString(), e);
return false;
}
}

View File

@ -17,35 +17,29 @@
package org.apache.activemq.artemis.logs;
import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.Message;
/**
* Logger Code 20
*
* each message id must be 6 digits long starting with 20, the 3rd digit should be 9
*
* so 209000 to 209999
*/
@MessageBundle(projectCode = "AMQ")
@LogBundle(projectCode = "AMQ", regexID = "20[0-9]{4}")
public interface ActiveMQUtilBundle {
ActiveMQUtilBundle BUNDLE = Messages.getBundle(ActiveMQUtilBundle.class);
ActiveMQUtilBundle BUNDLE = BundleFactory.newBundle(ActiveMQUtilBundle.class);
@Message(id = 209000, value = "invalid property: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 209000, value = "invalid property: {}")
ActiveMQIllegalStateException invalidProperty(String part);
@Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 209001, value = "Invalid type: {}")
IllegalStateException invalidType(Byte type);
@Message(id = 209002, value = "the specified string is too long ({0})", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 209002, value = "the specified string is too long ({})")
IllegalStateException stringTooLong(Integer length);
@Message(id = 209003, value = "Error instantiating codec {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName);
@Message(id = 209003, value = "Error instantiating codec {}")
IllegalArgumentException errorCreatingCodec(String codecClassName, Exception e);
@Message(id = 209004, value = "Failed to parse long value from {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 209004, value = "Failed to parse long value from {}")
IllegalArgumentException failedToParseLong(String value);
}

View File

@ -16,127 +16,71 @@
*/
package org.apache.activemq.artemis.logs;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.LogMessage;
/**
* Logger Code 20
*
* each message id must be 6 digits long starting with 20, the 3rd digit donates the level so
*
* INF0 1
* WARN 2
* DEBUG 3
* ERROR 4
* TRACE 5
* FATAL 6
*
* so an INFO message would be 201000 to 201999
*/
@MessageLogger(projectCode = "AMQ")
public interface ActiveMQUtilLogger extends BasicLogger {
@LogBundle(projectCode = "AMQ", regexID = "20[0-9]{4}")
public interface ActiveMQUtilLogger {
/**
* The default logger.
*/
ActiveMQUtilLogger LOGGER = Logger.getMessageLogger(ActiveMQUtilLogger.class, ActiveMQUtilLogger.class.getPackage().getName());
ActiveMQUtilLogger LOGGER = BundleFactory.newBundle(ActiveMQUtilLogger.class, ActiveMQUtilLogger.class.getPackage().getName());
@LogMessage(level = Logger.Level.INFO)
@Message(id = 201000, value = "Network is healthy, starting service {0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 201000, value = "Network is healthy, starting service {}", level = LogMessage.Level.INFO)
void startingService(String component);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 201001, value = "Network is unhealthy, stopping service {0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 201001, value = "Network is unhealthy, stopping service {}", level = LogMessage.Level.WARN)
void stoppingService(String component);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader", level = LogMessage.Level.WARN)
void missingPrivsForClassloader();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202001, value = "{0} is a loopback address and will be discarded.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202001, value = "{} is a loopback address and will be discarded.", level = LogMessage.Level.WARN)
void addressloopback(String address);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202002, value = "Ping Address {0} wasn't reacheable.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202002, value = "Ping Address {} wasn't reacheable.", level = LogMessage.Level.WARN)
void addressWasntReacheable(String address);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202003, value = "Ping Url {0} wasn't reacheable.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202003, value = "Ping Url {} wasn't reacheable.", level = LogMessage.Level.WARN)
void urlWasntReacheable(String url);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202004, value = "Error starting component {0} ",
format = Message.Format.MESSAGE_FORMAT)
void errorStartingComponent(@Cause Exception e, String component);
@LogMessage(id = 202004, value = "Error starting component {} ", level = LogMessage.Level.WARN)
void errorStartingComponent(String component, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202005, value = "Error stopping component {0} ",
format = Message.Format.MESSAGE_FORMAT)
void errorStoppingComponent(@Cause Exception e, String component);
@LogMessage(id = 202005, value = "Error stopping component {} ", level = LogMessage.Level.WARN)
void errorStoppingComponent(String component, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202006, value = "Failed to check Url {0}.",
format = Message.Format.MESSAGE_FORMAT)
void failedToCheckURL(@Cause Exception e, String url);
@LogMessage(id = 202006, value = "Failed to check Url {}.", level = LogMessage.Level.WARN)
void failedToCheckURL(String url, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202007, value = "Failed to check Address {0}.",
format = Message.Format.MESSAGE_FORMAT)
void failedToCheckAddress(@Cause Exception e, String address);
@LogMessage(id = 202007, value = "Failed to check Address {}.", level = LogMessage.Level.WARN)
void failedToCheckAddress(String address, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202008, value = "Failed to check Address list {0}.",
format = Message.Format.MESSAGE_FORMAT)
void failedToParseAddressList(@Cause Exception e, String addressList);
@LogMessage(id = 202008, value = "Failed to check Address list {}.", level = LogMessage.Level.WARN)
void failedToParseAddressList(String addressList, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202009, value = "Failed to check Url list {0}.",
format = Message.Format.MESSAGE_FORMAT)
void failedToParseUrlList(@Cause Exception e, String urlList);
@LogMessage(id = 202009, value = "Failed to check Url list {}.", level = LogMessage.Level.WARN)
void failedToParseUrlList(String urlList, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202010, value = "Failed to set NIC {0}.",
format = Message.Format.MESSAGE_FORMAT)
void failedToSetNIC(@Cause Exception e, String nic);
@LogMessage(id = 202010, value = "Failed to set NIC {}.", level = LogMessage.Level.WARN)
void failedToSetNIC(String nic, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202011, value = "Failed to read from stream {0}.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202011, value = "Failed to read from stream {}.", level = LogMessage.Level.WARN)
void failedToReadFromStream(String stream);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202012, value = "Object cannot be serialized.",
format = Message.Format.MESSAGE_FORMAT)
void failedToSerializeObject(@Cause Exception e);
@LogMessage(id = 202012, value = "Object cannot be serialized.", level = LogMessage.Level.WARN)
void failedToSerializeObject(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202013, value = "Unable to deserialize object.",
format = Message.Format.MESSAGE_FORMAT)
void failedToDeserializeObject(@Cause Exception e);
@LogMessage(id = 202013, value = "Unable to deserialize object.", level = LogMessage.Level.WARN)
void failedToDeserializeObject(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202014, value = "Unable to encode byte array into Base64 notation.",
format = Message.Format.MESSAGE_FORMAT)
void failedToEncodeByteArrayToBase64Notation(@Cause Exception e);
@LogMessage(id = 202014, value = "Unable to encode byte array into Base64 notation.", level = LogMessage.Level.WARN)
void failedToEncodeByteArrayToBase64Notation(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202015, value = "Failed to clean up file {0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202015, value = "Failed to clean up file {}", level = LogMessage.Level.WARN)
void failedToCleanupFile(String file);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 202016, value = "Could not list files to clean up in {0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 202016, value = "Could not list files to clean up in {}", level = LogMessage.Level.WARN)
void failedListFilesToCleanup(String path);
}

View File

@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.logs;
import java.lang.reflect.Constructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BundleFactory {
public static <T> T newBundle(final Class<T> type) {
return newBundle(type, type.getName());
}
public static <T> T newBundle(final Class<T> type, String category) {
final String implClassName = type.getName() + "_impl";
final Class<? extends T> implClass;
try {
implClass = Class.forName(implClassName, true, type.getClassLoader()).asSubclass(type);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to find class for log/message impl: " + implClassName, e);
}
final Constructor<? extends T> constructor;
try {
constructor = implClass.getConstructor(Logger.class);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to find constructor for log/message impl: " + implClassName, e);
}
try {
Logger logger = LoggerFactory.getLogger(category);
return type.cast(constructor.newInstance(logger));
} catch (Exception e) {
throw new IllegalArgumentException("Unable to create instance for log/message impl: " + implClassName, e);
}
}
}

View File

@ -1,134 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.logs;
import org.apache.commons.logging.Log;
import org.jboss.logging.Logger;
/**
* There is an issue on the Testsuite, as it's not possible
* to bring JBossLogging on the booting classLoader.
* As a result classes like BeanUtils will be using apache logging,
* which will not have the bootstrapping necessary.
*
* As a result BeanUtils is keeping showing log.debug into the test output and test console.
*
* This class will give an opportunity to the CI and our applications to use proper logging even on the testsuite.
* */
public class JBossLoggingApacheLoggerBridge implements Log {
final Logger bridgeLog;
public JBossLoggingApacheLoggerBridge(Class clazz) {
bridgeLog = Logger.getLogger(clazz);
}
public JBossLoggingApacheLoggerBridge(String name) {
bridgeLog = Logger.getLogger(name);
}
@Override
public void debug(Object message) {
bridgeLog.debug(message);
}
@Override
public void debug(Object message, Throwable t) {
bridgeLog.debug(message, t);
}
@Override
public void error(Object message) {
bridgeLog.error(message);
}
@Override
public void error(Object message, Throwable t) {
bridgeLog.error(message, t);
}
@Override
public void fatal(Object message) {
bridgeLog.fatal(message);
}
@Override
public void fatal(Object message, Throwable t) {
bridgeLog.fatal(message, t);
}
@Override
public void info(Object message) {
bridgeLog.info(message);
}
@Override
public void info(Object message, Throwable t) {
bridgeLog.info(message, t);
}
@Override
public boolean isDebugEnabled() {
return bridgeLog.isDebugEnabled();
}
@Override
public boolean isErrorEnabled() {
return bridgeLog.isEnabled(Logger.Level.ERROR);
}
@Override
public boolean isFatalEnabled() {
return bridgeLog.isEnabled(Logger.Level.FATAL);
}
@Override
public boolean isInfoEnabled() {
return bridgeLog.isInfoEnabled();
}
@Override
public boolean isTraceEnabled() {
return bridgeLog.isTraceEnabled();
}
@Override
public boolean isWarnEnabled() {
return bridgeLog.isEnabled(Logger.Level.WARN);
}
@Override
public void trace(Object message) {
bridgeLog.trace(message);
}
@Override
public void trace(Object message, Throwable t) {
bridgeLog.trace(message, t);
}
@Override
public void warn(Object message) {
bridgeLog.warn(message);
}
@Override
public void warn(Object message, Throwable t) {
bridgeLog.warn(message, t);
}
}

View File

@ -29,7 +29,7 @@ import io.netty.util.internal.PlatformDependent;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.logs.ActiveMQUtilBundle;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
public class ByteUtil {

View File

@ -19,7 +19,8 @@ package org.apache.activemq.artemis.utils;
import java.net.URL;
import java.util.Properties;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class will be used to perform generic class-loader operations,
@ -30,7 +31,7 @@ import org.jboss.logging.Logger;
public final class ClassloadingUtil {
private static final Logger logger = Logger.getLogger(ClassloadingUtil.class);
private static final Logger logger = LoggerFactory.getLogger(ClassloadingUtil.class);
private static final String INSTANTIATION_EXCEPTION_MESSAGE = "Your class must have a constructor without arguments. If it is an inner class, it must be static!";
@ -135,7 +136,7 @@ public final class ClassloadingUtil {
properties.load(url.openStream());
}
} catch (Throwable ignored) {
logger.warn(ignored);
logger.warn(ignored.getMessage(), ignored);
}
return properties;
}

View File

@ -32,7 +32,8 @@ import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A DefaultSensitiveDataCodec
@ -48,7 +49,7 @@ import org.jboss.logging.Logger;
*/
public class DefaultSensitiveStringCodec implements SensitiveDataCodec<String> {
private static final Logger logger = Logger.getLogger(DefaultSensitiveStringCodec.class);
private static final Logger logger = LoggerFactory.getLogger(DefaultSensitiveStringCodec.class);
public static final String ALGORITHM = "algorithm";
public static final String BLOWFISH_KEY = "key";

View File

@ -198,7 +198,7 @@ public final class PasswordMaskingUtil {
// As a last resort, load the codec class using the current thread's context class loader
return (SensitiveDataCodec<String>) Thread.currentThread().getContextClassLoader().loadClass(codecClassName).newInstance();
} catch (Exception e2) {
throw ActiveMQUtilBundle.BUNDLE.errorCreatingCodec(e2, codecClassName);
throw ActiveMQUtilBundle.BUNDLE.errorCreatingCodec(codecClassName, e2);
}
}
});

View File

@ -20,7 +20,8 @@ package org.apache.activemq.artemis.utils;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SizeAwareMetric {
@ -28,7 +29,7 @@ public class SizeAwareMetric {
void add(int delta, boolean sizeOnly);
}
private static final Logger logger = Logger.getLogger(SizeAwareMetric.class);
private static final Logger logger = LoggerFactory.getLogger(SizeAwareMetric.class);
private static final int PENDING_FREE = 0, FREE = 1, PENDING_OVER_SIZE = 2, OVER_SIZE = 3, PENDING_OVER_ELEMENTS = 4, OVER_ELEMENTS = 5, NOT_USED = -1;

View File

@ -27,14 +27,10 @@ import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import org.jboss.logging.Logger;
public class SpawnedVMSupport {
static ConcurrentHashMap<Process, String> startedProcesses = null;
private static final Logger log = Logger.getLogger(SpawnedVMSupport.class);
public static Process spawnVM(final String className, final String... args) throws Exception {
return SpawnedVMSupport.spawnVM(className, new String[0], true, args);
}
@ -59,7 +55,7 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final String... args) throws Exception {
return SpawnedVMSupport.spawnVM(className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, true, args);
return SpawnedVMSupport.spawnVM(className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, args);
}
public static Process spawnVM(final String classpath,
@ -67,7 +63,7 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final String... args) throws Exception {
return SpawnedVMSupport.spawnVM(classpath, className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, true, args);
return SpawnedVMSupport.spawnVM(classpath, className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, args);
}
public static Process spawnVMWithLogMacher(String wordMatch,
@ -76,7 +72,7 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final String... args) throws Exception {
return SpawnedVMSupport.spawnVM(wordMatch, runnable, className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, true, args);
return SpawnedVMSupport.spawnVM(wordMatch, runnable, className, "-Xms512m", "-Xmx512m", vmargs, logOutput, true, args);
}
public static Process spawnVM(final String className,
@ -85,9 +81,8 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final boolean logErrorOutput,
final boolean useLogging,
final String... args) throws Exception {
return spawnVM(null, null, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, useLogging, args);
return spawnVM(null, null, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, args);
}
public static Process spawnVM(final String classPath,
@ -97,9 +92,8 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final boolean logErrorOutput,
final boolean useLogging,
final String... args) throws Exception {
return spawnVM(classPath, null, null, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, useLogging, args);
return spawnVM(classPath, null, null, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, args);
}
public static Process spawnVM(final String wordMatch,
@ -110,9 +104,8 @@ public class SpawnedVMSupport {
final String[] vmargs,
final boolean logOutput,
final boolean logErrorOutput,
final boolean useLogging,
final String... args) throws Exception {
return spawnVM(getClassPath(), wordMatch, wordRunning, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, useLogging, args);
return spawnVM(getClassPath(), wordMatch, wordRunning, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, args);
}
@ -125,9 +118,8 @@ public class SpawnedVMSupport {
String[] vmargs,
boolean logOutput,
boolean logErrorOutput,
boolean useLogging,
String... args) throws IOException, ClassNotFoundException {
return spawnVM(classPath, wordMatch, wordRunning, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, useLogging, -1, args);
return spawnVM(classPath, wordMatch, wordRunning, className, memoryArg1, memoryArg2, vmargs, logOutput, logErrorOutput, -1, args);
}
public static String getClassPath() {
@ -170,7 +162,6 @@ public class SpawnedVMSupport {
* @param vmargs
* @param logOutput
* @param logErrorOutput
* @param useLogging
* @param debugPort if &lt;=0 it means no debug
* @param args
* @return
@ -186,7 +177,6 @@ public class SpawnedVMSupport {
String[] vmargs,
boolean logOutput,
boolean logErrorOutput,
boolean useLogging,
long debugPort,
String... args) throws IOException, ClassNotFoundException {
final String javaPath = Paths.get(System.getProperty("java.home"), "bin", "java").toAbsolutePath().toString();
@ -211,19 +201,12 @@ public class SpawnedVMSupport {
}
}
// The logs will be huge if you don't set this
if (useLogging) {
commandList.add("-Djava.util.logging.manager=org.jboss.logmanager.LogManager");
commandList.add("-Dlogging.configuration=file:../config/logging.properties");
}
commandList.add("-Djava.io.tmpdir=" + System.getProperty("java.io.tmpdir", "./tmp"));
commandList.add("-Djava.library.path=" + System.getProperty("java.library.path", "./native/bin"));
String loggingConfigFile = System.getProperty("java.util.logging.config.file");
String loggingConfigFile = System.getProperty("log4j2.configurationFile");
if (loggingConfigFile != null) {
commandList.add("-Djava.util.logging.config.file=" + loggingConfigFile + " ");
commandList.add("-Dlog4j2.configurationFile=" + loggingConfigFile);
}
String jacocoAgent = System.getProperty("jacoco.agent");
@ -231,11 +214,6 @@ public class SpawnedVMSupport {
commandList.add(jacocoAgent);
}
String loggingPlugin = System.getProperty("org.jboss.logging.Logger.pluginClass");
if (loggingPlugin != null) {
commandList.add("-Dorg.jboss.logging.Logger.pluginClass=" + loggingPlugin + " ");
}
commandList.add(className);
for (String arg : args) {
commandList.add(arg);

View File

@ -19,7 +19,8 @@
package org.apache.activemq.artemis.utils;
import org.apache.activemq.artemis.logs.ActiveMQUtilLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.PrintWriter;
@ -31,6 +32,7 @@ import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
public final class ThreadDumpUtil {
private static final Logger logger = LoggerFactory.getLogger(ThreadDumpUtil.class);
public static String threadDump(final String msg) {
@ -66,7 +68,7 @@ public final class ThreadDumpUtil {
return str.toString();
} catch (IOException e) {
ActiveMQUtilLogger.LOGGER.error("Exception thrown during generating of thread dump.", e);
logger.error("Exception thrown during generating of thread dump.", e);
}
return "Generating of thread dump failed " + msg;

View File

@ -23,7 +23,8 @@ import io.netty.util.internal.PlatformDependent;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.logs.ActiveMQUtilBundle;
import org.apache.activemq.artemis.logs.ActiveMQUtilLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A UTF8Util
@ -32,6 +33,8 @@ import org.apache.activemq.artemis.logs.ActiveMQUtilLogger;
*/
public final class UTF8Util {
private static final Logger logger = LoggerFactory.getLogger(UTF8Util.class);
private static final ThreadLocal<SoftReference<StringUtilBuffer>> currentBuffer = new ThreadLocal<>();
private UTF8Util() {
@ -85,9 +88,9 @@ public final class UTF8Util {
final int stringLength = str.length();
if (ActiveMQUtilLogger.LOGGER.isTraceEnabled()) {
if (logger.isTraceEnabled()) {
// This message is too verbose for debug, that's why we are using trace here
ActiveMQUtilLogger.LOGGER.trace("Saving string with utfSize=" + len + " stringSize=" + stringLength);
logger.trace("Saving string with utfSize=" + len + " stringSize=" + stringLength);
}
if (out.hasArray()) {
@ -183,9 +186,9 @@ public final class UTF8Util {
final int size = input.readUnsignedShort();
if (ActiveMQUtilLogger.LOGGER.isTraceEnabled()) {
if (logger.isTraceEnabled()) {
// This message is too verbose for debug, that's why we are using trace here
ActiveMQUtilLogger.LOGGER.trace("Reading string with utfSize=" + size);
logger.trace("Reading string with utfSize=" + size);
}
if (PlatformDependent.hasUnsafe() && input.byteBuf() != null && input.byteBuf().hasMemoryAddress()) {
final ByteBuf byteBuf = input.byteBuf();

View File

@ -32,10 +32,13 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.logs.ActiveMQUtilLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class UUIDGenerator {
private static final Logger logger = LoggerFactory.getLogger(UUIDGenerator.class);
private static final UUIDGenerator sSingleton = new UUIDGenerator();
// Windows has some fake adapters that will return the same HARDWARE ADDRESS on any computer. We need to ignore those
@ -122,8 +125,8 @@ public final class UUIDGenerator {
*/
dummy[0] |= (byte) 0x01;
if (ActiveMQUtilLogger.LOGGER.isDebugEnabled()) {
ActiveMQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy));
if (logger.isDebugEnabled()) {
logger.debug("using dummy address " + UUIDGenerator.asString(dummy));
}
return dummy;
}
@ -153,8 +156,8 @@ public final class UUIDGenerator {
byte[] address = findFirstMatchingHardwareAddress(ifaces);
if (address != null) {
if (ActiveMQUtilLogger.LOGGER.isDebugEnabled()) {
ActiveMQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address));
if (logger.isDebugEnabled()) {
logger.debug("using hardware address " + UUIDGenerator.asString(address));
}
return address;
}

View File

@ -20,7 +20,8 @@ package org.apache.activemq.artemis.utils.actors;
import java.util.concurrent.Executor;
import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An executor that always runs all tasks in order, using a delegate executor to run the tasks.
@ -34,7 +35,7 @@ public class OrderedExecutor extends ProcessorBase<Runnable> implements ArtemisE
super(delegate);
}
private static final Logger logger = Logger.getLogger(OrderedExecutor.class);
private static final Logger logger = LoggerFactory.getLogger(OrderedExecutor.class);
private boolean fair;

View File

@ -24,11 +24,12 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.function.Consumer;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class ProcessorBase<T> extends HandlerBase {
private static final Logger logger = Logger.getLogger(ProcessorBase.class);
private static final Logger logger = LoggerFactory.getLogger(ProcessorBase.class);
public static final int STATE_NOT_RUNNING = 0;
public static final int STATE_RUNNING = 1;
public static final int STATE_FORCED_SHUTDOWN = 2;

View File

@ -21,11 +21,12 @@ import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.function.ToIntFunction;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ThresholdActor<T> extends ProcessorBase<Object> {
private static final Logger logger = Logger.getLogger(ThresholdActor.class);
private static final Logger logger = LoggerFactory.getLogger(ThresholdActor.class);
private static final AtomicIntegerFieldUpdater<ThresholdActor> SIZE_UPDATER = AtomicIntegerFieldUpdater.newUpdater(ThresholdActor.class, "size");
private volatile int size = 0;

View File

@ -26,7 +26,8 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.locks.StampedLock;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.activemq.artemis.utils.Preconditions.checkArgument;
@ -40,7 +41,7 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkArgument;
*/
public class ConcurrentLongHashSet {
private static final Logger logger = Logger.getLogger(ConcurrentLongHashSet.class);
private static final Logger logger = LoggerFactory.getLogger(ConcurrentLongHashSet.class);
private static final long EmptyItem = -1L;
private static final long DeletedItem = -2L;

View File

@ -24,11 +24,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent;
import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CriticalAnalyzerImpl implements CriticalAnalyzer {
private final Logger logger = Logger.getLogger(CriticalAnalyzer.class);
private final Logger logger = LoggerFactory.getLogger(CriticalAnalyzer.class);
private volatile long timeoutNanoSeconds;

View File

@ -20,7 +20,8 @@ package org.apache.activemq.artemis.utils.critical;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import org.apache.activemq.artemis.utils.ArtemisCloseable;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CriticalMeasure {
@ -28,7 +29,7 @@ public class CriticalMeasure {
return closeable == dummyCloseable;
}
private static final Logger logger = Logger.getLogger(CriticalMeasure.class);
private static final Logger logger = LoggerFactory.getLogger(CriticalMeasure.class);
// this is used on enterCritical, if the logger is in trace mode
private volatile Exception traceEnter;

View File

@ -26,11 +26,12 @@ import org.apache.activemq.artemis.api.core.Pair;
import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
import org.apache.commons.beanutils.FluentPropertyBeanIntrospector;
import org.apache.commons.beanutils.IntrospectionContext;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FluentPropertyBeanIntrospectorWithIgnores extends FluentPropertyBeanIntrospector {
static Logger logger = Logger.getLogger(FluentPropertyBeanIntrospectorWithIgnores.class);
static Logger logger = LoggerFactory.getLogger(FluentPropertyBeanIntrospectorWithIgnores.class);
private static ConcurrentHashSet<Pair<String, String>> ignores = new ConcurrentHashSet<>();

View File

@ -27,7 +27,8 @@ import java.util.Map;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.internal.PlatformDependent;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
@ -39,7 +40,7 @@ import static org.junit.Assert.fail;
public class ByteUtilTest {
private static final Logger log = Logger.getLogger(ByteUtilTest.class);
private static final Logger log = LoggerFactory.getLogger(ByteUtilTest.class);
@Test
public void testBytesToString() {

View File

@ -16,7 +16,8 @@
*/
package org.apache.activemq.artemis.utils;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Test;
import java.util.HashMap;
@ -29,7 +30,7 @@ import static org.junit.Assert.fail;
public class DefaultSensitiveStringCodecTest {
private static final Logger log = Logger.getLogger(DefaultSensitiveStringCodecTest.class);
private static final Logger log = LoggerFactory.getLogger(DefaultSensitiveStringCodecTest.class);
@Test
public void testDefaultAlgorithm() throws Exception {

View File

@ -26,12 +26,13 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Test;
public class OrderedExecutorSanityTest {
private static final Logger log = Logger.getLogger(OrderedExecutorSanityTest.class);
private static final Logger log = LoggerFactory.getLogger(OrderedExecutorSanityTest.class);
@Test
public void shouldExecuteTasksInOrder() throws InterruptedException {

View File

@ -27,13 +27,14 @@ import java.util.concurrent.locks.LockSupport;
import org.apache.activemq.artemis.utils.ReusableLatch;
import org.apache.activemq.artemis.utils.Wait;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Test;
public class MultiThreadCriticalMeasureTest {
private static final Logger logger = Logger.getLogger(MultiThreadCriticalMeasureTest.class);
private static final Logger logger = LoggerFactory.getLogger(MultiThreadCriticalMeasureTest.class);
@Test
public void testMultiThread() throws Throwable {

View File

@ -41,33 +41,15 @@
<artifactId>artemis-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<optional>true</optional>
<scope>provided</scope>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>

View File

@ -32,35 +32,23 @@
</properties>
<dependencies>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<!-- Superfluous, except for osgi manifest handling -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jgroups</groupId>

View File

@ -23,14 +23,15 @@ import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.server.ComponentConfigurationRoutingType;
import org.apache.activemq.artemis.utils.critical.CriticalAnalyzerPolicy;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Default values of ActiveMQ Artemis configuration parameters.
*/
public final class ActiveMQDefaultConfiguration {
private static final Logger logger = Logger.getLogger(ActiveMQDefaultConfiguration.class);
private static final Logger logger = LoggerFactory.getLogger(ActiveMQDefaultConfiguration.class);
/*
* <p> In order to avoid compile time in-lining of constants, all access is done through methods
@ -511,7 +512,7 @@ public final class ActiveMQDefaultConfiguration {
maxDisk = Integer.parseInt(System.getProperty(ActiveMQDefaultConfiguration.getDefaultSystemPropertyPrefix() + "maxDiskUsage", "90"));
} catch (Throwable e) {
// This is not really supposed to happen, so just logging it, just in case
logger.warn(e);
logger.warn(e.getMessage(), e);
maxDisk = 90;
}
DEFAULT_MAX_DISK_USAGE = maxDisk;

View File

@ -17,7 +17,8 @@
package org.apache.activemq.artemis.api.core;
import org.apache.activemq.artemis.api.core.jgroups.JChannelManager;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jgroups.JChannel;
/**
@ -27,7 +28,7 @@ import org.jgroups.JChannel;
*/
public class ChannelBroadcastEndpointFactory implements BroadcastEndpointFactory {
private static final Logger logger = Logger.getLogger(ChannelBroadcastEndpointFactory.class);
private static final Logger logger = LoggerFactory.getLogger(ChannelBroadcastEndpointFactory.class);
private final JChannel channel;

View File

@ -21,7 +21,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.api.core.jgroups.JChannelManager;
import org.apache.activemq.artemis.api.core.jgroups.JChannelWrapper;
import org.apache.activemq.artemis.api.core.jgroups.JGroupsReceiver;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jgroups.JChannel;
/**
@ -29,7 +30,7 @@ import org.jgroups.JChannel;
*/
public abstract class JGroupsBroadcastEndpoint implements BroadcastEndpoint {
private static final Logger logger = Logger.getLogger(JGroupsBroadcastEndpoint.class);
private static final Logger logger = LoggerFactory.getLogger(JGroupsBroadcastEndpoint.class);
private final String channelName;

View File

@ -155,7 +155,7 @@ public final class UDPBroadcastEndpointFactory implements BroadcastEndpointFacto
continue;
} catch (IOException e) {
if (open) {
ActiveMQClientLogger.LOGGER.unableToReceiveBroadcast(e, this.toString());
ActiveMQClientLogger.LOGGER.unableToReceiveBroadcast(this.toString(), e);
}
}
break;

View File

@ -21,7 +21,8 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.activemq.artemis.api.core.JGroupsBroadcastEndpoint;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class maintain a global Map of JChannels wrapped in JChannelWrapper for
@ -54,7 +55,7 @@ public class JChannelManager {
// this is useful for testcases using a single channel.
private boolean loopbackMessages = false;
private final Logger logger = Logger.getLogger(JChannelManager.class);
private final Logger logger = LoggerFactory.getLogger(JChannelManager.class);
private static final Map<String, JChannelWrapper> channels = new HashMap<>();

View File

@ -20,10 +20,11 @@ package org.apache.activemq.artemis.api.core.jgroups;
import java.util.ArrayList;
import java.util.List;
import org.jboss.logging.Logger;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.Receiver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class wraps a JChannel with a reference counter. The reference counter
@ -32,7 +33,7 @@ import org.jgroups.Receiver;
*/
public class JChannelWrapper {
private static final Logger logger = Logger.getLogger(JChannelWrapper.class);
private static final Logger logger = LoggerFactory.getLogger(JChannelWrapper.class);
private boolean connected = false;
int refCount = 1;

View File

@ -21,7 +21,8 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jgroups.Receiver;
/**
@ -30,7 +31,7 @@ import org.jgroups.Receiver;
*/
public class JGroupsReceiver implements Receiver {
private static final Logger logger = Logger.getLogger(JGroupsReceiver.class);
private static final Logger logger = LoggerFactory.getLogger(JGroupsReceiver.class);
private final BlockingQueue<byte[]> dequeue = new LinkedBlockingDeque<>();

View File

@ -16,565 +16,332 @@
*/
package org.apache.activemq.artemis.core.client;
import java.net.UnknownHostException;
import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
import org.apache.activemq.artemis.api.core.Interceptor;
import org.apache.activemq.artemis.core.protocol.core.Packet;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.LogMessage;
import org.apache.activemq.artemis.logs.BundleFactory;
import org.w3c.dom.Node;
import java.net.UnknownHostException;
/**
* Logger Code 21
* <p>
* Each message id must be 6 digits long starting with 21, the 3rd digit donates the level so
*
* <pre>
* INF0 1
* WARN 2
* DEBUG 3
* ERROR 4
* TRACE 5
* FATAL 6
* </pre>
*
* so an INFO message would be 211000 to 211999.
* <p>
* Once released, methods should not be deleted as they may be referenced by knowledge base
* articles. Unused methods should be marked as deprecated.
*/
@MessageLogger(projectCode = "AMQ")
public interface ActiveMQClientLogger extends BasicLogger {
@LogBundle(projectCode = "AMQ", regexID = "21[0-9]{4}")
public interface ActiveMQClientLogger {
/**
* The default logger.
*/
ActiveMQClientLogger LOGGER = Logger.getMessageLogger(ActiveMQClientLogger.class, ActiveMQClientLogger.class.getPackage().getName());
ActiveMQClientLogger LOGGER = BundleFactory.newBundle(ActiveMQClientLogger.class, ActiveMQClientLogger.class.getPackage().getName());
@LogMessage(level = Logger.Level.INFO)
@Message(id = 211000, value = "**** Dumping session creation stacks ****", format = Message.Format.MESSAGE_FORMAT)
void dumpingSessionStacks();
@LogMessage(id = 212001, value = "Error on clearing messages", level = LogMessage.Level.WARN)
void errorClearingMessages(Throwable e);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 211001, value = "session created", format = Message.Format.MESSAGE_FORMAT)
void dumpingSessionStack(@Cause Exception e);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 211002, value = "Started {0} Netty Connector version {1} to {2}:{3,number,#}", format = Message.Format.MESSAGE_FORMAT)
void startedNettyConnector(String connectorType, String version, String host, Integer port);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 211003, value = "Started InVM Connector", format = Message.Format.MESSAGE_FORMAT)
void startedInVMConnector();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212000, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
void warn(String message);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212001, value = "Error on clearing messages", format = Message.Format.MESSAGE_FORMAT)
void errorClearingMessages(@Cause Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212002, value = "Timed out waiting for handler to complete processing", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212002, value = "Timed out waiting for handler to complete processing", level = LogMessage.Level.WARN)
void timeOutWaitingForProcessing();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212003, value = "Unable to close session", format = Message.Format.MESSAGE_FORMAT)
void unableToCloseSession(@Cause Exception e);
@LogMessage(id = 212003, value = "Unable to close session", level = LogMessage.Level.WARN)
void unableToCloseSession(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212004, value = "Failed to connect to server.", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212004, value = "Failed to connect to server.", level = LogMessage.Level.WARN)
void failedToConnectToServer();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212005, value = "Tried {0} times to connect. Now giving up on reconnecting it.", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212005, value = "Tried {} times to connect. Now giving up on reconnecting it.", level = LogMessage.Level.WARN)
void failedToConnectToServer(Integer reconnectAttempts);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212007,
value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.",
format = Message.Format.MESSAGE_FORMAT)
void createConnectorException(@Cause Exception e);
@LogMessage(id = 212007, value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.", level = LogMessage.Level.WARN)
void createConnectorException(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212008,
value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly " + "before letting them go out of scope! {0}",
format = Message.Format.MESSAGE_FORMAT)
void factoryLeftOpen(@Cause Exception e, int i);
@LogMessage(id = 212008, value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly " + "before letting them go out of scope! {}", level = LogMessage.Level.WARN)
void factoryLeftOpen(int i, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212009, value = "resetting session after failure", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212009, value = "resetting session after failure", level = LogMessage.Level.WARN)
void resettingSessionAfterFailure();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212010, value = "Server is starting, retry to create the session {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212010, value = "Server is starting, retry to create the session {}", level = LogMessage.Level.WARN)
void retryCreateSessionSeverStarting(String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", level = LogMessage.Level.WARN)
void commitAfterFailover();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212012, value = "failure occurred during commit throwing XAException", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212012, value = "failure occurred during commit throwing XAException", level = LogMessage.Level.WARN)
void failoverDuringCommit();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212014, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212014, value = "failover occurred during prepare rolling back", level = LogMessage.Level.WARN)
void failoverDuringPrepareRollingBack();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212015, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT)
void errorDuringPrepare(@Cause Throwable e);
@LogMessage(id = 212015, value = "failover occurred during prepare rolling back", level = LogMessage.Level.WARN)
void errorDuringPrepare(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212016,
value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}",
format = Message.Format.MESSAGE_FORMAT)
void clientSessionNotClosed(@Cause Exception e, int identity);
@LogMessage(id = 212016, value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {}", level = LogMessage.Level.WARN)
void clientSessionNotClosed(int identity, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212017, value = "error adding packet", format = Message.Format.MESSAGE_FORMAT)
void errorAddingPacket(@Cause Exception e);
@LogMessage(id = 212017, value = "error adding packet", level = LogMessage.Level.WARN)
void errorAddingPacket(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212018, value = "error calling cancel", format = Message.Format.MESSAGE_FORMAT)
void errorCallingCancel(@Cause Exception e);
@LogMessage(id = 212018, value = "error calling cancel", level = LogMessage.Level.WARN)
void errorCallingCancel(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212019, value = "error reading index", format = Message.Format.MESSAGE_FORMAT)
void errorReadingIndex(@Cause Exception e);
@LogMessage(id = 212019, value = "error reading index", level = LogMessage.Level.WARN)
void errorReadingIndex(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212020, value = "error setting index", format = Message.Format.MESSAGE_FORMAT)
void errorSettingIndex(@Cause Exception e);
@LogMessage(id = 212020, value = "error setting index", level = LogMessage.Level.WARN)
void errorSettingIndex(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212021, value = "error resetting index", format = Message.Format.MESSAGE_FORMAT)
void errorReSettingIndex(@Cause Exception e);
@LogMessage(id = 212021, value = "error resetting index", level = LogMessage.Level.WARN)
void errorReSettingIndex(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212022, value = "error reading LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
void errorReadingCache(@Cause Exception e);
@LogMessage(id = 212022, value = "error reading LargeMessage file cache", level = LogMessage.Level.WARN)
void errorReadingCache(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212023, value = "error closing LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
void errorClosingCache(@Cause Exception e);
@LogMessage(id = 212023, value = "error closing LargeMessage file cache", level = LogMessage.Level.WARN)
void errorClosingCache(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212024, value = "Exception during finalization for LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT)
void errorFinalisingCache(@Cause Exception e);
@LogMessage(id = 212024, value = "Exception during finalization for LargeMessage file cache", level = LogMessage.Level.WARN)
void errorFinalisingCache(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212025, value = "did not connect the cluster connection to other nodes", format = Message.Format.MESSAGE_FORMAT)
void errorConnectingToNodes(@Cause Exception e);
@LogMessage(id = 212025, value = "did not connect the cluster connection to other nodes", level = LogMessage.Level.WARN)
void errorConnectingToNodes(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212026, value = "Timed out waiting for pool to terminate", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212026, value = "Timed out waiting for pool to terminate", level = LogMessage.Level.WARN)
void timedOutWaitingForTermination();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212027, value = "Timed out waiting for scheduled pool to terminate", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212027, value = "Timed out waiting for scheduled pool to terminate", level = LogMessage.Level.WARN)
void timedOutWaitingForScheduledPoolTermination();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT)
void errorStartingLocator(@Cause Exception e);
@LogMessage(id = 212028, value = "error starting server locator", level = LogMessage.Level.WARN)
void errorStartingLocator(Exception e);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 212029,
value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}",
format = Message.Format.MESSAGE_FORMAT)
void serverLocatorNotClosed(@Cause Exception e, int identity);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212030, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
void errorSendingTopology(@Cause Throwable e);
@LogMessage(id = 212030, value = "error sending topology", level = LogMessage.Level.WARN)
void errorSendingTopology(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212031, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT)
void errorSendingTopologyNodedown(@Cause Throwable e);
@LogMessage(id = 212031, value = "error sending topology", level = LogMessage.Level.WARN)
void errorSendingTopologyNodedown(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212032, value = "Timed out waiting to stop discovery thread", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212032, value = "Timed out waiting to stop discovery thread", level = LogMessage.Level.WARN)
void timedOutStoppingDiscovery();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212033, value = "unable to send notification when discovery group is stopped", format = Message.Format.MESSAGE_FORMAT)
void errorSendingNotifOnDiscoveryStop(@Cause Throwable e);
@LogMessage(id = 212033, value = "unable to send notification when discovery group is stopped", level = LogMessage.Level.WARN)
void errorSendingNotifOnDiscoveryStop(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212034,
value = "There are more than one servers on the network broadcasting the same node id. " + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " + "ignored. But if it is logged continuously it means you really do have more than one node on the same network " + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " + "its live node. nodeID={0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212034, value = "There are more than one servers on the network broadcasting the same node id. " + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " + "ignored. But if it is logged continuously it means you really do have more than one node on the same network " + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " + "its live node. nodeID={}", level = LogMessage.Level.WARN)
void multipleServersBroadcastingSameNode(String nodeId);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212035, value = "error receiving packet in discovery", format = Message.Format.MESSAGE_FORMAT)
void errorReceivingPacketInDiscovery(@Cause Throwable e);
@LogMessage(id = 212035, value = "error receiving packet in discovery", level = LogMessage.Level.WARN)
void errorReceivingPacketInDiscovery(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212036,
value = "Can not find packet to clear: {0} last received command id first stored command id {1}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212036, value = "Can not find packet to clear: {} last received command id first stored command id {}", level = LogMessage.Level.WARN)
void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212037, value = "Connection failure to {0} has been detected: {1} [code={2}]", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212037, value = "Connection failure to {} has been detected: {} [code={}]", level = LogMessage.Level.WARN)
void connectionFailureDetected(String remoteAddress, String message, ActiveMQExceptionType type);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT)
void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor);
@LogMessage(id = 212038, value = "Failure in calling interceptor: {}", level = LogMessage.Level.WARN)
void errorCallingInterceptor(Interceptor interceptor, Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212040, value = "Timed out waiting for netty ssl close future to complete", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212040, value = "Timed out waiting for netty ssl close future to complete", level = LogMessage.Level.WARN)
void timeoutClosingSSL();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212041, value = "Timed out waiting for netty channel to close", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212041, value = "Timed out waiting for netty channel to close", level = LogMessage.Level.WARN)
void timeoutClosingNettyChannel();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212042, value = "Timed out waiting for packet to be flushed", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212042, value = "Timed out waiting for packet to be flushed", level = LogMessage.Level.WARN)
void timeoutFlushingPacket();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212043, value = "Property {0} must be an Integer, it is {1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212043, value = "Property {} must be an Integer, it is {}", level = LogMessage.Level.WARN)
void propertyNotInteger(String propName, String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212044, value = "Property {0} must be a Long, it is {1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212044, value = "Property {} must be a Long, it is {}", level = LogMessage.Level.WARN)
void propertyNotLong(String propName, String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212045, value = "Property {0} must be a Boolean, it is {1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212045, value = "Property {} must be a Boolean, it is {}", level = LogMessage.Level.WARN)
void propertyNotBoolean(String propName, String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212046, value = "Cannot find activemq-version.properties on classpath: {0}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212046, value = "Cannot find activemq-version.properties on classpath: {}", level = LogMessage.Level.WARN)
void noVersionOnClasspath(String classpath);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {0}:{1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {}:{}", level = LogMessage.Level.WARN)
void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212048, value = "Random address ({0}) was already in use, trying another time",
format = Message.Format.MESSAGE_FORMAT)
void broadcastGroupBindErrorRetry(String hostAndPort, @Cause Throwable t);
@LogMessage(id = 212048, value = "Random address ({}) was already in use, trying another time", level = LogMessage.Level.WARN)
void broadcastGroupBindErrorRetry(String hostAndPort, Throwable t);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212049,
value = "Could not bind to {0} ({1} address); " +
"make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." +
"\nIgnoring discovery group-address, but this may lead to cross talking.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212049, value = "Could not bind to {} ({} address); " + "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." + "\nIgnoring discovery group-address, but this may lead to cross talking.", level = LogMessage.Level.WARN)
void ioDiscoveryError(String hostAddress, String s);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212050, value = "Compressed large message tried to read {0} bytes from stream {1}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212050, value = "Compressed large message tried to read {} bytes from stream {}", level = LogMessage.Level.WARN)
void compressedLargeMessageError(int length, int nReadBytes);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212051,
value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.",
format = Message.Format.MESSAGE_FORMAT)
void invalidConcurrentSessionUsage(@Cause Throwable t);
@LogMessage(id = 212051, value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.", level = LogMessage.Level.WARN)
void invalidConcurrentSessionUsage(Throwable t);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212052,
value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored",
format = Message.Format.MESSAGE_FORMAT)
void packetOutOfOrder(Object obj, @Cause Throwable t);
@LogMessage(id = 212052, value = "Packet {} was answered out of sequence due to a previous server timeout and it's being ignored", level = LogMessage.Level.WARN)
void packetOutOfOrder(Object obj, Throwable t);
/**
* Warns about usage of {@link org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with
* confirmations disabled (confirmationWindowSize=-1).
*/
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212053,
value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212053, value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!", level = LogMessage.Level.WARN)
void confirmationWindowDisabledWarning();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212054,
value = "Destination address={0} is blocked. If the system is configured to block make sure you consume messages on this configuration.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212054, value = "Destination address={} is blocked. If the system is configured to block make sure you consume messages on this configuration.", level = LogMessage.Level.WARN)
void outOfCreditOnFlowControl(String address);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212055, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT)
void unableToCloseConsumer(@Cause Exception e);
@LogMessage(id = 212055, value = "Unable to close consumer", level = LogMessage.Level.WARN)
void unableToCloseConsumer(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212056, value = "local-bind-address specified for broadcast group but no local-bind-port. Using random port for UDP Broadcast ({0})",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212056, value = "local-bind-address specified for broadcast group but no local-bind-port. Using random port for UDP Broadcast ({})", level = LogMessage.Level.WARN)
void broadcastGroupBindError(String hostAndPort);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212057, value = "Large Message Streaming is taking too long to flush on back pressure.",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212057, value = "Large Message Streaming is taking too long to flush on back pressure.", level = LogMessage.Level.WARN)
void timeoutStreamingLargeMessage();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212058, value = "Unable to get a message.",
format = Message.Format.MESSAGE_FORMAT)
void unableToGetMessage(@Cause Exception e);
@LogMessage(id = 212058, value = "Unable to get a message.", level = LogMessage.Level.WARN)
void unableToGetMessage(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212059, value = "Failed to clean up: {0} ",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212059, value = "Failed to clean up: {} ", level = LogMessage.Level.WARN)
void failedCleaningUp(String target);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212060, value = "Unexpected null data received from DiscoveryEndpoint ",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212060, value = "Unexpected null data received from DiscoveryEndpoint ", level = LogMessage.Level.WARN)
void unexpectedNullDataReceived();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212061, value = "Failed to perform force close ",
format = Message.Format.MESSAGE_FORMAT)
void failedForceClose(@Cause Throwable e);
@LogMessage(id = 212061, value = "Failed to perform force close ", level = LogMessage.Level.WARN)
void failedForceClose(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212062, value = "Failed to perform post actions on message processing ",
format = Message.Format.MESSAGE_FORMAT)
void failedPerformPostActionsOnMessage(@Cause Exception e);
@LogMessage(id = 212062, value = "Failed to perform post actions on message processing ", level = LogMessage.Level.WARN)
void failedPerformPostActionsOnMessage(Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212063, value = "Unable to handle connection failure ",
format = Message.Format.MESSAGE_FORMAT)
void unableToHandleConnectionFailure(@Cause Throwable e);
@LogMessage(id = 212063, value = "Unable to handle connection failure ", level = LogMessage.Level.WARN)
void unableToHandleConnectionFailure(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212064, value = "Unable to receive cluster topology ",
format = Message.Format.MESSAGE_FORMAT)
void unableToReceiveClusterTopology(@Cause Throwable e);
@LogMessage(id = 212064, value = "Unable to receive cluster topology ", level = LogMessage.Level.WARN)
void unableToReceiveClusterTopology(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212065, value = "{0} getting exception when receiving broadcasting ",
format = Message.Format.MESSAGE_FORMAT)
void unableToReceiveBroadcast(@Cause Exception e, String target);
@LogMessage(id = 212065, value = "{} getting exception when receiving broadcasting ", level = LogMessage.Level.WARN)
void unableToReceiveBroadcast(String target, Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212066, value = "failed to parse int property ",
format = Message.Format.MESSAGE_FORMAT)
void unableToParseValue(@Cause Throwable e);
@LogMessage(id = 212066, value = "failed to parse int property ", level = LogMessage.Level.WARN)
void unableToParseValue(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212067, value = "failed to get system property ",
format = Message.Format.MESSAGE_FORMAT)
void unableToGetProperty(@Cause Throwable e);
@LogMessage(id = 212067, value = "failed to get system property ", level = LogMessage.Level.WARN)
void unableToGetProperty(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212068, value = "Couldn't finish the client globalThreadPool in less than 10 seconds, interrupting it now ",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212068, value = "Couldn't finish the client globalThreadPool in less than 10 seconds, interrupting it now ", level = LogMessage.Level.WARN)
void unableToProcessGlobalThreadPoolIn10Sec();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212069, value = "Couldn't finish the client scheduled in less than 10 seconds, interrupting it now ",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212069, value = "Couldn't finish the client scheduled in less than 10 seconds, interrupting it now ", level = LogMessage.Level.WARN)
void unableToProcessScheduledlIn10Sec();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212070, value = "Unable to initialize VersionLoader ",
format = Message.Format.MESSAGE_FORMAT)
void unableToInitVersionLoader(@Cause Throwable e);
@LogMessage(id = 212070, value = "Unable to initialize VersionLoader ", level = LogMessage.Level.WARN)
void unableToInitVersionLoader(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212071, value = "Unable to check Epoll availability ",
format = Message.Format.MESSAGE_FORMAT)
void unableToCheckEpollAvailability(@Cause Throwable e);
@LogMessage(id = 212071, value = "Unable to check Epoll availability ", level = LogMessage.Level.WARN)
void unableToCheckEpollAvailability(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212072, value = "Failed to change channel state to ReadyForWriting ",
format = Message.Format.MESSAGE_FORMAT)
void failedToSetChannelReadyForWriting(@Cause Throwable e);
@LogMessage(id = 212072, value = "Failed to change channel state to ReadyForWriting ", level = LogMessage.Level.WARN)
void failedToSetChannelReadyForWriting(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212073, value = "Unable to check KQueue availability ",
format = Message.Format.MESSAGE_FORMAT)
void unableToCheckKQueueAvailability(@Cause Throwable e);
@LogMessage(id = 212073, value = "Unable to check KQueue availability ", level = LogMessage.Level.WARN)
void unableToCheckKQueueAvailability(Throwable e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212074, value = "SendAcknowledgementHandler will not be asynchronous without setting up confirmation window size",
format = Message.Format.MESSAGE_FORMAT)
void confirmationNotSet();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212075, value = "KQueue is not available, please add to the classpath or configure useKQueue=false to remove this warning",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212075, value = "KQueue is not available, please add to the classpath or configure useKQueue=false to remove this warning", level = LogMessage.Level.WARN)
void unableToCheckKQueueAvailabilityNoClass();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212076, value = "Epoll is not available, please add to the classpath or configure useEpoll=false to remove this warning",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212076, value = "Epoll is not available, please add to the classpath or configure useEpoll=false to remove this warning", level = LogMessage.Level.WARN)
void unableToCheckEpollAvailabilitynoClass();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212077, value = "Timed out waiting to receive initial broadcast from cluster. Retry {0} of {1}",
format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212077, value = "Timed out waiting to receive initial broadcast from cluster. Retry {} of {}", level = LogMessage.Level.WARN)
void broadcastTimeout(int retry, int maxretry);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212079, value = "The upstream connector from the downstream federation will ignore url parameter {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212079, value = "The upstream connector from the downstream federation will ignore url parameter {}", level = LogMessage.Level.WARN)
void ignoredParameterForDownstreamFederation(String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212080, value = "Using legacy SSL store provider value: {0}. Please use either ''keyStoreType'' or ''trustStoreType'' instead as appropriate.", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 212080, value = "Using legacy SSL store provider value: {}. Please use either 'keyStoreType' or 'trustStoreType' instead as appropriate.", level = LogMessage.Level.WARN)
void oldStoreProvider(String value);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)
void onMessageError(@Cause Throwable e);
@LogMessage(id = 214000, value = "Failed to call onMessage", level = LogMessage.Level.ERROR)
void onMessageError(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214001, value = "failed to cleanup session", format = Message.Format.MESSAGE_FORMAT)
void failedToCleanupSession(@Cause Exception e);
@LogMessage(id = 214001, value = "failed to cleanup session", level = LogMessage.Level.ERROR)
void failedToCleanupSession(Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214002, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
void failedToExecuteListener(@Cause Throwable t);
@LogMessage(id = 214002, value = "Failed to execute failure listener", level = LogMessage.Level.ERROR)
void failedToExecuteListener(Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214003, value = "Failed to handle failover", format = Message.Format.MESSAGE_FORMAT)
void failedToHandleFailover(@Cause Throwable t);
@LogMessage(id = 214003, value = "Failed to handle failover", level = LogMessage.Level.ERROR)
void failedToHandleFailover(Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214004, value = "XA end operation failed ", format = Message.Format.MESSAGE_FORMAT)
void errorCallingEnd(@Cause Throwable t);
@LogMessage(id = 214004, value = "XA end operation failed ", level = LogMessage.Level.ERROR)
void errorCallingEnd(Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214005, value = "XA start operation failed {0} code:{1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 214005, value = "XA start operation failed {} code:{}", level = LogMessage.Level.ERROR)
void errorCallingStart(String message, Integer code);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214006, value = "Session is not XA", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 214006, value = "Session is not XA", level = LogMessage.Level.ERROR)
void sessionNotXA();
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214007, value = "Received exception asynchronously from server", format = Message.Format.MESSAGE_FORMAT)
void receivedExceptionAsynchronously(@Cause Exception e);
@LogMessage(id = 214007, value = "Received exception asynchronously from server", level = LogMessage.Level.ERROR)
void receivedExceptionAsynchronously(Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214008, value = "Failed to handle packet", format = Message.Format.MESSAGE_FORMAT)
void failedToHandlePacket(@Cause Exception e);
@LogMessage(id = 214008, value = "Failed to handle packet", level = LogMessage.Level.ERROR)
void failedToHandlePacket(Exception e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214009, value = "Failed to stop discovery group", format = Message.Format.MESSAGE_FORMAT)
void failedToStopDiscovery(@Cause Throwable e);
@LogMessage(id = 214009, value = "Failed to stop discovery group", level = LogMessage.Level.ERROR)
void failedToStopDiscovery(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214010, value = "Failed to receive datagram", format = Message.Format.MESSAGE_FORMAT)
void failedToReceiveDatagramInDiscovery(@Cause Throwable e);
@LogMessage(id = 214010, value = "Failed to receive datagram", level = LogMessage.Level.ERROR)
void failedToReceiveDatagramInDiscovery(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214011, value = "Failed to call discovery listener", format = Message.Format.MESSAGE_FORMAT)
void failedToCallListenerInDiscovery(@Cause Throwable e);
@LogMessage(id = 214011, value = "Failed to call discovery listener", level = LogMessage.Level.ERROR)
void failedToCallListenerInDiscovery(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214012, value = "Unexpected error handling packet {0}", format = Message.Format.MESSAGE_FORMAT)
void errorHandlingPacket(@Cause Throwable t, Packet packet);
@LogMessage(id = 214013, value = "Failed to decode packet", level = LogMessage.Level.ERROR)
void errorDecodingPacket(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214013, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT)
void errorDecodingPacket(@Cause Throwable e);
@LogMessage(id = 214014, value = "Failed to execute failure listener", level = LogMessage.Level.ERROR)
void errorCallingFailureListener(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214014, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT)
void errorCallingFailureListener(@Cause Throwable e);
@LogMessage(id = 214015, value = "Failed to execute connection life cycle listener", level = LogMessage.Level.ERROR)
void errorCallingLifeCycleListener(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214015, value = "Failed to execute connection life cycle listener", format = Message.Format.MESSAGE_FORMAT)
void errorCallingLifeCycleListener(@Cause Throwable e);
@LogMessage(id = 214016, value = "Failed to create netty connection", level = LogMessage.Level.ERROR)
void errorCreatingNettyConnection(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214016, value = "Failed to create netty connection", format = Message.Format.MESSAGE_FORMAT)
void errorCreatingNettyConnection(@Cause Throwable e);
@LogMessage(id = 214017, value = "Caught unexpected Throwable", level = LogMessage.Level.ERROR)
void caughtunexpectedThrowable(Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214017, value = "Caught unexpected Throwable", format = Message.Format.MESSAGE_FORMAT)
void caughtunexpectedThrowable(@Cause Throwable t);
@LogMessage(id = 214018, value = "Failed to invoke getTextContent() on node {}", level = LogMessage.Level.ERROR)
void errorOnXMLTransform(Node n, Throwable t);
@Deprecated
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214018, value = "Failed to invoke getTextContent() on node {0}", format = Message.Format.MESSAGE_FORMAT)
void errorOnXMLTransform(@Cause Throwable t, Node n);
@LogMessage(id = 214019, value = "Invalid configuration", level = LogMessage.Level.ERROR)
void errorOnXMLTransformInvalidConf(Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214019, value = "Invalid configuration", format = Message.Format.MESSAGE_FORMAT)
void errorOnXMLTransformInvalidConf(@Cause Throwable t);
@LogMessage(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {}", level = LogMessage.Level.ERROR)
void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", format = Message.Format.MESSAGE_FORMAT)
void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {}", level = LogMessage.Level.ERROR)
void invalidCipherSuite(String validSuites);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214022, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 214022, value = "Invalid protocol specified. Supported protocols are: {}", level = LogMessage.Level.ERROR)
void invalidProtocol(String validProtocols);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 214023, value = "HTTP Handshake failed, received %s")
void httpHandshakeFailed(Object msg);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214024, value = "HTTP upgrade not supported by remote acceptor")
void httpUpgradeNotSupportedByRemoteAcceptor();
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214025, value = "Invalid type {0}, Using default connection factory at {1}", format = Message.Format.MESSAGE_FORMAT)
@LogMessage(id = 214025, value = "Invalid type {}, Using default connection factory at {}", level = LogMessage.Level.ERROR)
void invalidCFType(String type, String uri);
@LogMessage(level = Logger.Level.TRACE)
@Message(id = 214026,
value = "Failure captured on connectionID={0}, performing failover or reconnection now",
format = Message.Format.MESSAGE_FORMAT)
void failoverOrReconnect(Object connectionID, @Cause Throwable cause);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 214027,
value = "Replaying commands for channelID={0} with lastCommandID from the server={1}",
format = Message.Format.MESSAGE_FORMAT)
void replayingCommands(Object connectionID, int lastConfirmedCommandID);
@LogMessage(level = Logger.Level.DEBUG)
@Message(id = 214028,
value = "Couldn't reattach session {0}, performing as a failover operation now and recreating objects",
format = Message.Format.MESSAGE_FORMAT)
void reconnectCreatingNewSession(long id);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214029, value = "Unexpected response from HTTP server: %s")
@LogMessage(id = 214029, value = "Unexpected response from HTTP server: {}", level = LogMessage.Level.ERROR)
void unexpectedResponseFromHttpServer(Object response);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214030, value = "Failed to bind {0}={1}", format = Message.Format.MESSAGE_FORMAT)
void failedToBind(String p1, String p2, @Cause Throwable cause);
@LogMessage(id = 214030, value = "Failed to bind {}={}", level = LogMessage.Level.ERROR)
void failedToBind(String p1, String p2, Throwable cause);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214031, value = "Failed to decode buffer, disconnect immediately.", format = Message.Format.MESSAGE_FORMAT)
void disconnectOnErrorDecoding(@Cause Throwable cause);
@LogMessage(id = 214031, value = "Failed to decode buffer, disconnect immediately.", level = LogMessage.Level.ERROR)
void disconnectOnErrorDecoding(Throwable cause);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214032, value = "Unable to initialize VersionLoader ",
format = Message.Format.MESSAGE_FORMAT)
void unableToInitVersionLoaderError(@Cause Throwable e);
@LogMessage(id = 214032, value = "Unable to initialize VersionLoader ", level = LogMessage.Level.ERROR)
void unableToInitVersionLoaderError(Throwable e);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214033, value = "Cannot resolve host ",
format = Message.Format.MESSAGE_FORMAT)
void unableToResolveHost(@Cause UnknownHostException e);
@LogMessage(id = 214033, value = "Cannot resolve host ", level = LogMessage.Level.ERROR)
void unableToResolveHost(UnknownHostException e);
}

View File

@ -32,36 +32,31 @@ import org.apache.activemq.artemis.api.core.ActiveMQTransactionOutcomeUnknownExc
import org.apache.activemq.artemis.api.core.ActiveMQTransactionRolledBackException;
import org.apache.activemq.artemis.api.core.ActiveMQUnBlockedException;
import org.apache.activemq.artemis.core.cluster.DiscoveryGroup;
import org.apache.activemq.artemis.logs.annotation.LogBundle;
import org.apache.activemq.artemis.logs.annotation.Message;
import org.apache.activemq.artemis.logs.BundleFactory;
import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
import org.w3c.dom.Node;
/**
* Logger Code 21
*
* each message id must be 6 digits long starting with 21, the 3rd digit should be 9
*
* so 219000 to 219999
*/
@MessageBundle(projectCode = "AMQ")
@LogBundle(projectCode = "AMQ", regexID = "21[0-9]{4}")
public interface ActiveMQClientMessageBundle {
ActiveMQClientMessageBundle BUNDLE = Messages.getBundle(ActiveMQClientMessageBundle.class);
ActiveMQClientMessageBundle BUNDLE = BundleFactory.newBundle(ActiveMQClientMessageBundle.class);
@Message(id = 219000, value = "ClientSession closed while creating session")
ActiveMQInternalErrorException clientSessionClosed();
@Message(id = 219001, value = "Failed to create session")
ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
ActiveMQInternalErrorException failedToCreateSession(Throwable t);
@Message(id = 219003, value = "Queue can not be both durable and temporary")
ActiveMQInternalErrorException queueMisConfigured();
@Message(id = 219004, value = "Failed to initialise session factory")
ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
ActiveMQInternalErrorException failedToInitialiseSessionFactory(Exception e);
@Message(id = 219005, value = "Exception in Netty transport")
ActiveMQInternalErrorException nettyError();
@ -73,7 +68,7 @@ public interface ActiveMQClientMessageBundle {
ActiveMQNotConnectedException cannotConnectToServers();
@Message(id = 219008, value = "Failed to connect to any static connectors")
ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
ActiveMQNotConnectedException cannotConnectToStaticConnectors(Exception e);
@Message(id = 219009, value = "Failed to connect to any static connectors")
ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
@ -81,23 +76,23 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219010, value = "Connection is destroyed")
ActiveMQNotConnectedException connectionDestroyed();
@Message(id = 219011, value = "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219011, value = "Did not receive data from server for {}")
ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
@Message(id = 219012, value = "Timed out waiting to receive initial broadcast from cluster")
ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
@Message(id = 219013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219013, value = "Timed out waiting to receive cluster topology. Group:{}")
ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
@Message(id = 219014, value = "Timed out after waiting {0} ms for response when sending packet {1}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219014, value = "Timed out after waiting {} ms for response when sending packet {}")
ActiveMQConnectionTimedOutException timedOutSendingPacket(long timeout, Byte type);
@Message(id = 219015, value = "The connection was disconnected because of server shutdown")
ActiveMQDisconnectedException disconnected();
@Message(id = 219016, value = "Connection failure detected. Unblocking a blocking call that will never get a response")
ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
ActiveMQUnBlockedException unblockingACall(Throwable t);
@Message(id = 219017, value = "Consumer is closed")
ActiveMQObjectClosedException consumerClosed();
@ -114,8 +109,7 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219021, value = "Cannot set MessageHandler - consumer is in receive(...)")
ActiveMQIllegalStateException inReceive();
@Message(id = 219022, value = "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize",
format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219022, value = "Header size ({}) is too big, use the messageBody for large data, or increase minLargeMessageSize")
ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize);
@Message(id = 219023, value = "The large message lost connection with its session, either because of a rollback or a closed session")
@ -125,19 +119,19 @@ public interface ActiveMQClientMessageBundle {
ActiveMQIllegalStateException noTCForSessionFactory();
@Message(id = 219025, value = "Error saving the message body")
ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
ActiveMQLargeMessageException errorSavingBody(Exception e);
@Message(id = 219026, value = "Error reading the LargeMessageBody")
ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
ActiveMQLargeMessageException errorReadingBody(Exception e);
@Message(id = 219027, value = "Error closing stream from LargeMessageBody")
ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
ActiveMQLargeMessageException errorClosingLargeMessage(Exception e);
@Message(id = 219028, value = "Timeout waiting for LargeMessage Body")
ActiveMQLargeMessageException timeoutOnLargeMessage();
@Message(id = 219029, value = "Error writing body of message")
ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
ActiveMQLargeMessageException errorWritingLargeMessage(Exception e);
@Message(id = 219030, value = "The transaction was rolled back on failover to a backup server")
ActiveMQTransactionRolledBackException txRolledBack();
@ -145,23 +139,22 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219031, value = "The transaction was rolled back on failover however commit may have been successful")
ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown();
@Message(id = 219032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219032, value = "Invalid type: {}")
IllegalArgumentException invalidType(Object type);
@Message(id = 219033, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219033, value = "Invalid type: {}")
IllegalArgumentException invalidEncodeType(Object type);
@Message(id = 219034, value = "Params for management operations must be of the following type: int long double String boolean Map or array thereof but found {0}",
format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219034, value = "Params for management operations must be of the following type: int long double String boolean Map or array thereof but found {}")
IllegalArgumentException invalidManagementParam(Object type);
@Message(id = 219035, value = "Invalid window size {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219035, value = "Invalid window size {}")
IllegalArgumentException invalidWindowSize(Integer size);
@Message(id = 219037, value = "Invalid last Received Command ID: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219037, value = "Invalid last Received Command ID: {}")
IllegalArgumentException invalidCommandID(Integer lastReceivedCommandID);
@Message(id = 219038, value = "Cannot find channel with id {0} to close", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219038, value = "Cannot find channel with id {} to close")
IllegalArgumentException noChannelToClose(Long id);
@Message(id = 219039, value = "Close Listener cannot be null")
@ -170,7 +163,7 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219040, value = "Fail Listener cannot be null")
IllegalArgumentException failListenerCannotBeNull();
@Message(id = 219041, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219041, value = "Connection already exists with id {}")
IllegalArgumentException connectionExists(Object id);
@Message(id = 219042, value = "Invalid argument null listener")
@ -191,7 +184,7 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219048, value = "nodes have a different number of attributes")
IllegalArgumentException nodeHaveDifferentAttNumber();
@Message(id = 219049, value = "attribute {0}={1} does not match", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219049, value = "attribute {}={} does not match")
IllegalArgumentException attsDontMatch(String name, String value);
@Message(id = 219050, value = "one node has children and the other does not")
@ -200,25 +193,25 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219051, value = "nodes have a different number of children")
IllegalArgumentException nodeHasDifferentChildNumber();
@Message(id = 219052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219052, value = "Element {} requires a valid Boolean value, but '{}' cannot be parsed as a Boolean")
IllegalArgumentException mustBeBoolean(Node elem, String value);
@Message(id = 219053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219053, value = "Element {} requires a valid Double value, but '{}' cannot be parsed as a Double")
IllegalArgumentException mustBeDouble(Node elem, String value);
@Message(id = 219054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as an Integer", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219054, value = "Element {} requires a valid Integer value, but '{}' cannot be parsed as an Integer")
IllegalArgumentException mustBeInteger(Node elem, String value);
@Message(id = 219055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219055, value = "Element {} requires a valid Long value, but '{}' cannot be parsed as a Long")
IllegalArgumentException mustBeLong(Node element, String value);
@Message(id = 219057, value = "Error decoding password")
IllegalArgumentException errordecodingPassword(@Cause Exception e);
IllegalArgumentException errordecodingPassword(Exception e);
@Message(id = 219058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219058, value = "Address \"{}\" is full. Message encode size = {}B")
ActiveMQAddressFullException addressIsFull(String addressName, int size);
@Message(id = 219059, value = "Interceptor {0} rejected packet in a blocking call. This call will never complete.", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219059, value = "Interceptor {} rejected packet in a blocking call. This call will never complete.")
ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
@Message(id = 219060, value = "Large Message Transmission interrupted on consumer shutdown.")
@ -233,15 +226,15 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219063, value = "Cannot send a packet while response cache is full.")
IllegalStateException cannotSendPacketWhilstResponseCacheFull();
@Message(id = 219064, value = "Invalide packet: {0}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219064, value = "Invalide packet: {}")
IllegalStateException invalidPacket(byte type);
@Message(id = 219065, value = "Failed to handle packet.")
RuntimeException failedToHandlePacket(@Cause Exception e);
RuntimeException failedToHandlePacket(Exception e);
@Message(id = 219066, value = "The connection was redirected")
ActiveMQRoutingException redirected();
@Message(id = 219067, value = "Keystore alias {0} not found in {1}", format = Message.Format.MESSAGE_FORMAT)
@Message(id = 219067, value = "Keystore alias {} not found in {}")
IllegalArgumentException keystoreAliasNotFound(String keystoreAlias, String keystorePath);
}

View File

@ -21,11 +21,12 @@ import org.apache.activemq.artemis.api.core.ActiveMQAddressFullException;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.spi.core.remoting.SessionContext;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractProducerCreditsImpl implements ClientProducerCredits {
private static final Logger logger = Logger.getLogger(AbstractProducerCreditsImpl.class);
private static final Logger logger = LoggerFactory.getLogger(AbstractProducerCreditsImpl.class);
protected int pendingCredits;
@ -85,7 +86,7 @@ public abstract class AbstractProducerCreditsImpl implements ClientProducerCredi
protected void afterAcquired(int credits) throws ActiveMQAddressFullException {
if (logger.isDebugEnabled()) {
logger.debugf("AfterAcquire %s credits on address %s", credits, address);
logger.debug("AfterAcquire {} credits on address {}", credits, address);
}
synchronized (this) {
pendingCredits -= credits;
@ -117,7 +118,7 @@ public abstract class AbstractProducerCreditsImpl implements ClientProducerCredi
@Override
public synchronized void reset() {
logger.debugf("reset credits on address %s", address);
logger.debug("reset credits on address {}", address);
// Any pendingCredits credits from before failover won't arrive, so we re-initialise
int beforeFailure = pendingCredits;
@ -151,7 +152,7 @@ public abstract class AbstractProducerCreditsImpl implements ClientProducerCredi
protected void checkCredits(final int credits) {
int needed = Math.max(credits, windowSize);
if (logger.isTraceEnabled()) {
logger.tracef("CheckCredits %s on address %s, needed=%s, credits=%s, window=%s", credits, address, needed, credits, windowSize);
logger.trace("CheckCredits {} on address {}, needed={}, credits={}, window={}", credits, address, needed, credits, windowSize);
}
int toRequest = -1;
@ -161,27 +162,27 @@ public abstract class AbstractProducerCreditsImpl implements ClientProducerCredi
toRequest = needed - arriving;
if (logger.isTraceEnabled()) {
logger.tracef("CheckCredits on Address %s, requesting=%s, arriving=%s, balance=%s", address, toRequest, arriving, getBalance());
logger.trace("CheckCredits on Address {}, requesting={}, arriving={}, balance={}", address, toRequest, arriving, getBalance());
}
} else {
if (logger.isTraceEnabled()) {
logger.tracef("CheckCredits did not need it, balance=%s, arriving=%s, needed=%s, getbalance + arriving < needed=%s", getBalance(), arriving, needed, (boolean)(getBalance() + arriving < needed));
logger.trace("CheckCredits did not need it, balance={}, arriving={}, needed={}, getbalance + arriving < needed={}", getBalance(), arriving, needed, (boolean)(getBalance() + arriving < needed));
}
}
}
if (toRequest > 0) {
if (logger.isDebugEnabled()) {
logger.debugf("Requesting %s credits on address %s, needed = %s, arriving = %s", toRequest, address, needed, arriving);
logger.debug("Requesting {} credits on address {}, needed = {}, arriving = {}", toRequest, address, needed, arriving);
}
requestCredits(toRequest);
} else {
logger.debugf("not asking for %s credits on %s", toRequest, address);
logger.debug("not asking for {} credits on {}", toRequest, address);
}
}
protected void requestCredits(final int credits) {
logger.debugf("Request %s credits on address %s", credits, address);
logger.debug("Request {} credits on address {}", credits, address);
synchronized (this) {
pendingCredits += credits;
arriving += credits;

View File

@ -18,11 +18,12 @@
package org.apache.activemq.artemis.core.client.impl;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl {
private static final Logger logger = Logger.getLogger(AsynchronousProducerCreditsImpl.class);
private static final Logger logger = LoggerFactory.getLogger(AsynchronousProducerCreditsImpl.class);
int balance;
@ -40,7 +41,7 @@ public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl
synchronized (this) {
balance -= credits;
if (logger.isDebugEnabled()) {
logger.debugf("actualAcquire on address %s with credits=%s, balance=%s, callbackType=%s", address, credits, balance, callback.getClass());
logger.debug("actualAcquire on address {} with credits={}, balance={}, callbackType={}", address, credits, balance, callback.getClass());
}
if (balance <= 0) {
callback.onCreditsFlow(true, this);
@ -60,13 +61,13 @@ public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl
super.receiveCredits(credits);
balance += credits;
if (logger.isDebugEnabled()) {
logger.debugf("receiveCredits with credits=%s, balance=%s, arriving=%s, callbackType=%s", credits, balance, arriving, callback.getClass());
logger.debug("receiveCredits with credits={}, balance={}, arriving={}, callbackType={}", credits, balance, arriving, callback.getClass());
}
callback.onCreditsFlow(balance <= 0, this);
if (balance < 0 && arriving == 0) {
// there are no more credits arriving and we are still negative, async large message send asked too much and we need to counter balance
logger.debugf("Starve credits counter balance");
logger.debug("Starve credits counter balance");
int request = -balance + windowSize * 2;
requestCredits(request);
}
@ -79,7 +80,7 @@ public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl
public void receiveFailCredits(final int credits) {
super.receiveFailCredits(credits);
if (logger.isDebugEnabled()) {
logger.debugf("creditsFail %s, callback=%s", credits, callback.getClass());
logger.debug("creditsFail {}, callback={}", credits, callback.getClass());
}
callback.onCreditsFail(this);
}
@ -90,7 +91,7 @@ public class AsynchronousProducerCreditsImpl extends AbstractProducerCreditsImpl
balance = 0;
callback.onCreditsFlow(true, this);
if (logger.isDebugEnabled()) {
logger.debugf("releaseOutstanding credits, balance=%s, callback=%s", balance, callback.getClass());
logger.debug("releaseOutstanding credits, balance={}, callback={}", balance, callback.getClass());
}
}

View File

@ -45,12 +45,13 @@ import org.apache.activemq.artemis.utils.TokenBucketLimiter;
import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
import org.apache.activemq.artemis.utils.collections.PriorityLinkedList;
import org.apache.activemq.artemis.utils.collections.PriorityLinkedListImpl;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class ClientConsumerImpl implements ClientConsumerInternal {
private static final Logger logger = Logger.getLogger(ClientConsumerImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ClientConsumerImpl.class);
private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;

View File

@ -33,14 +33,15 @@ import org.apache.activemq.artemis.utils.ActiveMQBufferInputStream;
import org.apache.activemq.artemis.utils.DeflaterReader;
import org.apache.activemq.artemis.utils.TokenBucketLimiter;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The client-side Producer.
*/
public class ClientProducerImpl implements ClientProducerInternal {
private static final Logger logger = Logger.getLogger(ClientProducerImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ClientProducerImpl.class);
private final SimpleString address;
@ -282,7 +283,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
// Not the continuations, but this is ok since we are only interested in limiting the amount of
// data in *memory* and continuations go straight to the disk
logger.tracef("sendRegularMessage::%s, Blocking=%s", msgI, sendBlocking);
logger.trace("sendRegularMessage::{}, Blocking={}", msgI, sendBlocking);
int creditSize = sessionContext.getCreditsOnSendingFull(msgI);
@ -308,7 +309,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
final ICoreMessage msgI,
final ClientProducerCredits credits,
SendAcknowledgementHandler handler) throws ActiveMQException {
logger.tracef("largeMessageSend::%s, Blocking=%s", msgI, sendBlocking);
logger.trace("largeMessageSend::{}, Blocking={}", msgI, sendBlocking);
int headerSize = msgI.getHeadersAndPropertiesEncodeSize();

View File

@ -70,11 +70,12 @@ import org.apache.activemq.artemis.utils.ExecutorFactory;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ClientConnectionLifeCycleListener {
private static final Logger logger = Logger.getLogger(ClientSessionFactoryImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ClientSessionFactoryImpl.class);
private final ServerLocatorInternal serverLocator;
@ -555,7 +556,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
private void failoverOrReconnect(final Object connectionID,
final ActiveMQException me,
String scaleDownTargetNodeID) {
ActiveMQClientLogger.LOGGER.failoverOrReconnect(connectionID, me);
logger.debug("Failure captured on connectionID={}, performing failover or reconnection now", connectionID, me);
for (ClientSessionInternal session : sessions) {
SessionContext context = session.getSessionContext();

View File

@ -58,11 +58,12 @@ import org.apache.activemq.artemis.utils.ConfirmationWindowWarning;
import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.apache.activemq.artemis.utils.XidCodecSupport;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class ClientSessionImpl implements ClientSessionInternal, FailureListener {
private static final Logger logger = Logger.getLogger(ClientSessionImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ClientSessionImpl.class);
private final Map<String, String> metadata = new HashMap<>();
@ -1526,7 +1527,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
@Override
public void setAddress(final Message message, final SimpleString address) {
logger.tracef("setAddress() Setting default address as %s", address);
logger.trace("setAddress() Setting default address as {}", address);
message.setAddress(address);
}

View File

@ -73,7 +73,8 @@ import org.apache.activemq.artemis.utils.UUIDGenerator;
import org.apache.activemq.artemis.utils.actors.Actor;
import org.apache.activemq.artemis.utils.actors.OrderedExecutor;
import org.apache.activemq.artemis.utils.uri.FluentPropertyBeanIntrospectorWithIgnores;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This is the implementation of {@link org.apache.activemq.artemis.api.core.client.ServerLocator} and all
@ -81,7 +82,7 @@ import org.jboss.logging.Logger;
*/
public final class ServerLocatorImpl implements ServerLocatorInternal, DiscoveryListener {
private static final Logger logger = Logger.getLogger(ServerLocatorImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ServerLocatorImpl.class);
private enum STATE {
INITIALIZED, CLOSED, CLOSING

View File

@ -31,11 +31,12 @@ import org.apache.activemq.artemis.api.core.client.ClusterTopologyListener;
import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.spi.core.remoting.Connector;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class Topology {
private static final Logger logger = Logger.getLogger(Topology.class);
private static final Logger logger = LoggerFactory.getLogger(Topology.class);
private final Set<ClusterTopologyListener> topologyListeners;
@ -204,7 +205,7 @@ public final class Topology {
}
if (manager != null && !manager.updateMember(uniqueEventID, nodeId, memberInput)) {
logger.debugf("TopologyManager rejected the update towards %s", memberInput);
logger.debug("TopologyManager rejected the update towards {}", memberInput);
return false;
}
@ -312,7 +313,7 @@ public final class Topology {
if (manager != null && !manager.removeMember(uniqueEventID, nodeId)) {
logger.debugf("TopologyManager rejected the update towards %s", nodeId);
logger.debug("TopologyManager rejected the update towards {}", nodeId);
return false;
}

View File

@ -40,7 +40,8 @@ import org.apache.activemq.artemis.core.server.management.Notification;
import org.apache.activemq.artemis.core.server.management.NotificationService;
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
import org.apache.activemq.artemis.utils.collections.TypedProperties;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class is used to search for members on the cluster through the opaque interface {@link BroadcastEndpoint}.
@ -52,7 +53,7 @@ import org.jboss.logging.Logger;
*/
public final class DiscoveryGroup implements ActiveMQComponent {
private static final Logger logger = Logger.getLogger(DiscoveryGroup.class);
private static final Logger logger = LoggerFactory.getLogger(DiscoveryGroup.class);
private final List<DiscoveryListener> listeners = new ArrayList<>();
@ -360,7 +361,7 @@ public final class DiscoveryGroup implements ActiveMQComponent {
if (logger.isTraceEnabled()) {
logger.trace("Connectors changed on Discovery:");
for (DiscoveryEntry connector : connectors.values()) {
logger.trace(connector);
logger.trace("{}", connector);
}
}
if (logger.isDebugEnabled()) {

View File

@ -58,7 +58,8 @@ import org.apache.activemq.artemis.reader.MessageUtil;
import org.apache.activemq.artemis.utils.DataConstants;
import org.apache.activemq.artemis.utils.UUID;
import org.apache.activemq.artemis.utils.collections.TypedProperties;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.activemq.artemis.utils.ByteUtil.ensureExactWritable;
@ -70,7 +71,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
protected volatile int memoryEstimate = -1;
private static final Logger logger = Logger.getLogger(CoreMessage.class);
private static final Logger logger = LoggerFactory.getLogger(CoreMessage.class);
// There's an integer with the number of bytes for the body
public static final int BODY_OFFSET = DataConstants.SIZE_INT;

View File

@ -34,11 +34,12 @@ import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.JsonUtil;
import org.apache.activemq.artemis.api.core.Message;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MessageOpenTypeFactory<M extends Message> {
private static final Logger logger = Logger.getLogger(MessageOpenTypeFactory.class);
private static final Logger logger = LoggerFactory.getLogger(MessageOpenTypeFactory.class);
public MessageOpenTypeFactory() {
try {

View File

@ -63,7 +63,8 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.apache.activemq.artemis.spi.core.remoting.SessionContext;
import org.apache.activemq.artemis.spi.core.remoting.TopologyResponseHandler;
import org.apache.activemq.artemis.utils.VersionLoader;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class will return specific packets for different types of actions happening on a messaging protocol.
@ -79,7 +80,7 @@ import org.jboss.logging.Logger;
public class ActiveMQClientProtocolManager implements ClientProtocolManager {
private static final Logger logger = Logger.getLogger(ActiveMQClientProtocolManager.class);
private static final Logger logger = LoggerFactory.getLogger(ActiveMQClientProtocolManager.class);
private static final String handshake = "ARTEMIS";

View File

@ -129,11 +129,12 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
import org.apache.activemq.artemis.spi.core.remoting.SessionContext;
import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ActiveMQSessionContext extends SessionContext {
private static final Logger logger = Logger.getLogger(ActiveMQSessionContext.class);
private static final Logger logger = LoggerFactory.getLogger(ActiveMQSessionContext.class);
private final Channel sessionChannel;
private final int serverVersion;
@ -846,14 +847,14 @@ public class ActiveMQSessionContext extends SessionContext {
ReattachSessionResponseMessage response = (ReattachSessionResponseMessage) channel1.sendBlocking(request, PacketImpl.REATTACH_SESSION_RESP);
if (response.isReattached()) {
ActiveMQClientLogger.LOGGER.replayingCommands(sessionChannel.getID(), response.getLastConfirmedCommandID());
logger.debug("Replaying commands for channelID={} with lastCommandID from the server={}", sessionChannel.getID(), response.getLastConfirmedCommandID());
// The session was found on the server - we reattached transparently ok
sessionChannel.replayCommands(response.getLastConfirmedCommandID());
return true;
} else {
ActiveMQClientLogger.LOGGER.reconnectCreatingNewSession(sessionChannel.getID());
logger.debug("Couldn't reattach session {}, performing as a failover operation now and recreating objects", sessionChannel.getID());
sessionChannel.clearCommands();
@ -1061,8 +1062,8 @@ public class ActiveMQSessionContext extends SessionContext {
final long elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedFlowControl);
ActiveMQClientLogger.LOGGER.timeoutStreamingLargeMessage();
if (logger.isDebugEnabled()) {
logger.debugf("try to write %d bytes after blocked %d ms on a not writable connection: [%s]",
chunkPacket.expectedEncodeSize(), elapsedMillis, connection.getID());
logger.debug("try to write {} bytes after blocked {} ms on a not writable connection: [{}]",
chunkPacket.expectedEncodeSize(), elapsedMillis, connection.getID());
}
}
if (requiresResponse) {

View File

@ -42,11 +42,12 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQEx
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.PacketsConfirmedMessage;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.utils.ConcurrentUtil;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class ChannelImpl implements Channel {
private static final Logger logger = Logger.getLogger(ChannelImpl.class);
private static final Logger logger = LoggerFactory.getLogger(ChannelImpl.class);
public enum CHANNEL_ID {
/**
@ -588,7 +589,7 @@ public final class ChannelImpl implements Channel {
return interceptor.getClass().getName();
}
} catch (final Throwable e) {
ActiveMQClientLogger.LOGGER.errorCallingInterceptor(e, interceptor);
ActiveMQClientLogger.LOGGER.errorCallingInterceptor(interceptor, e);
}
}
}

View File

@ -46,11 +46,12 @@ import org.apache.activemq.artemis.core.security.ActiveMQPrincipal;
import org.apache.activemq.artemis.spi.core.protocol.AbstractRemotingConnection;
import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.apache.activemq.artemis.utils.SimpleIDGenerator;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RemotingConnectionImpl extends AbstractRemotingConnection implements CoreRemotingConnection {
private static final Logger logger = Logger.getLogger(RemotingConnectionImpl.class);
private static final Logger logger = LoggerFactory.getLogger(RemotingConnectionImpl.class);
private final PacketDecoder packetDecoder;

View File

@ -30,11 +30,12 @@ import io.netty.handler.ssl.SslHandler;
import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CertificateUtil {
private static final Logger logger = Logger.getLogger(CertificateUtil.class);
private static final Logger logger = LoggerFactory.getLogger(CertificateUtil.class);
private static final String SSL_HANDLER_NAME = "ssl";

View File

@ -21,7 +21,8 @@ import io.netty.channel.epoll.Epoll;
import io.netty.channel.kqueue.KQueue;
import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
import org.apache.activemq.artemis.utils.Env;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class will check for Epoll or KQueue is available, and return false in case of NoClassDefFoundError
@ -29,7 +30,7 @@ import org.jboss.logging.Logger;
*/
public class CheckDependencies {
private static final Logger logger = Logger.getLogger(CheckDependencies.class);
private static final Logger logger = LoggerFactory.getLogger(CheckDependencies.class);
public static final boolean isEpollAvailable() {
try {

View File

@ -43,13 +43,14 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
import org.apache.activemq.artemis.utils.Env;
import org.apache.activemq.artemis.utils.IPV6Util;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull;
public class NettyConnection implements Connection {
private static final Logger logger = Logger.getLogger(NettyConnection.class);
private static final Logger logger = LoggerFactory.getLogger(NettyConnection.class);
private static final int DEFAULT_WAIT_MILLIS = 10_000;

View File

@ -123,7 +123,8 @@ import org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactoryProvid
import org.apache.activemq.artemis.utils.ConfigurationHelper;
import org.apache.activemq.artemis.utils.FutureLatch;
import org.apache.activemq.artemis.utils.IPV6Util;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.activemq.artemis.utils.Base64.encodeBytes;
@ -133,7 +134,7 @@ public class NettyConnector extends AbstractConnector {
public static String EPOLL_CONNECTOR_TYPE = "EPOLL";
public static String KQUEUE_CONNECTOR_TYPE = "KQUEUE";
private static final Logger logger = Logger.getLogger(NettyConnector.class);
private static final Logger logger = LoggerFactory.getLogger(NettyConnector.class);
public static final String JAVAX_KEYSTORE_PATH_PROP_NAME = "javax.net.ssl.keyStore";
public static final String JAVAX_KEYSTORE_PASSWORD_PROP_NAME = "javax.net.ssl.keyStorePassword";
@ -740,7 +741,7 @@ public class NettyConnector extends AbstractConnector {
if (handler != null) {
pipeline.addLast(new ActiveMQClientChannelHandler(channelGroup, handler, new Listener(), closeExecutor));
logger.debugf("Added ActiveMQClientChannelHandler to Channel with id = %s ", channel.id());
logger.debug("Added ActiveMQClientChannelHandler to Channel with id = {} ", channel.id());
}
}
});
@ -750,7 +751,7 @@ public class NettyConnector extends AbstractConnector {
batchFlusherFuture = scheduledThreadPool.scheduleWithFixedDelay(flusher, batchDelay, batchDelay, TimeUnit.MILLISECONDS);
}
ActiveMQClientLogger.LOGGER.startedNettyConnector(connectorType, TransportConstants.NETTY_VERSION, host, port);
logger.debug("Started {} Netty Connector version {} to {}:{}", connectorType, TransportConstants.NETTY_VERSION, host, port);
}
private SSLEngine loadJdkSslEngine(final SSLContextConfig sslContextConfig) throws Exception {
@ -927,7 +928,7 @@ public class NettyConnector extends AbstractConnector {
request.headers().set(SEC_ACTIVEMQ_REMOTING_KEY, key);
ch.attr(REMOTING_KEY).set(key);
logger.debugf("Sending HTTP request %s", request);
logger.debug("Sending HTTP request {}", request);
// Send the HTTP request.
ch.writeAndFlush(request);
@ -1026,7 +1027,7 @@ public class NettyConnector extends AbstractConnector {
handshakeComplete = true;
} else {
// HTTP upgrade failed
ActiveMQClientLogger.LOGGER.httpHandshakeFailed(msg);
logger.debug("HTTP Handshake failed, received {}", msg);
ctx.close();
latch.countDown();
}
@ -1040,7 +1041,7 @@ public class NettyConnector extends AbstractConnector {
channelHandler.active = true;
}
if (!handshakeComplete) {
ActiveMQClientLogger.LOGGER.httpHandshakeFailed(msg);
logger.debug("HTTP Handshake failed, received {}", msg);
ctx.close();
}
latch.countDown();
@ -1305,7 +1306,7 @@ public class NettyConnector extends AbstractConnector {
InetAddress address = InetAddress.getByName(host);
return address.isLoopbackAddress();
} catch (UnknownHostException e) {
ActiveMQClientLogger.LOGGER.error("Cannot resolve host", e);
logger.error("Cannot resolve host", e);
}
return false;
}

View File

@ -23,11 +23,12 @@ import java.util.Set;
import io.netty.handler.codec.socksx.SocksVersion;
import io.netty.util.Version;
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TransportConstants {
private static final Logger logger = Logger.getLogger(TransportConstants.class);
private static final Logger logger = LoggerFactory.getLogger(TransportConstants.class);
public static final String SSL_CONTEXT_PROP_NAME = "sslContext";
@ -378,7 +379,7 @@ public class TransportConstants {
return Integer.parseInt(variable);
}
} catch (Throwable ignored) {
logger.debug(ignored);
logger.debug(ignored.getMessage(), ignored);
}
return defaultValue;

View File

@ -36,7 +36,7 @@ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory {
*/
@Override
public SslContext getClientSslContext(final SSLContextConfig config, final Map<String, Object> additionalOpts) throws Exception {
log.debugf("Creating Client OpenSSL Context with %s", config);
log.debug("Creating Client OpenSSL Context with {}", config);
return new SSLSupport(config)
.setSslProvider(TransportConstants.OPENSSL_PROVIDER)
.createNettyClientContext();
@ -49,7 +49,7 @@ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory {
*/
@Override
public SslContext getServerSslContext(final SSLContextConfig config, final Map<String, Object> additionalOpts) throws Exception {
log.debugf("Creating Server OpenSSL Context with %s", config);
log.debug("Creating Server OpenSSL Context with {}", config);
return new SSLSupport(config)
.setSslProvider(TransportConstants.OPENSSL_PROVIDER)
.createNettyContext();

View File

@ -40,7 +40,7 @@ public class DefaultSSLContextFactory implements SSLContextFactory {
return SSLContext.getDefault();
}
log.debugf("Creating JDK SSLContext with %s", config);
log.debug("Creating JDK SSLContext with {}", config);
return new SSLSupport(config).createContext();
}

View File

@ -33,13 +33,14 @@ import org.apache.activemq.artemis.core.remoting.CloseListener;
import org.apache.activemq.artemis.core.remoting.FailureListener;
import org.apache.activemq.artemis.spi.core.remoting.Connection;
import org.apache.activemq.artemis.spi.core.remoting.ReadyListener;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.security.auth.Subject;
public abstract class AbstractRemotingConnection implements RemotingConnection {
private static final Logger logger = Logger.getLogger(AbstractRemotingConnection.class);
private static final Logger logger = LoggerFactory.getLogger(AbstractRemotingConnection.class);
protected final List<FailureListener> failureListeners = new CopyOnWriteArrayList<>();
protected final List<CloseListener> closeListeners = new CopyOnWriteArrayList<>();

View File

@ -19,7 +19,8 @@ package org.apache.activemq.artemis.spi.core.remoting.ssl;
import java.util.Map;
import io.netty.handler.ssl.SslContext;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Service interface to create an {@link SslContext} for a configuration.
@ -30,7 +31,7 @@ import org.jboss.logging.Logger;
*/
public interface OpenSSLContextFactory extends Comparable<OpenSSLContextFactory> {
Logger log = Logger.getLogger(OpenSSLContextFactory.class);
Logger log = LoggerFactory.getLogger(OpenSSLContextFactory.class);
/**
* Release any cached {@link SslContext} instances.

View File

@ -17,7 +17,8 @@ package org.apache.activemq.artemis.spi.core.remoting.ssl;
import java.util.Map;
import javax.net.ssl.SSLContext;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Service interface to create a SSLContext for a configuration.
@ -27,7 +28,7 @@ import org.jboss.logging.Logger;
* in your jar and fill it with the full qualified name of your implementation.
*/
public interface SSLContextFactory extends Comparable<SSLContextFactory> {
Logger log = Logger.getLogger(SSLContextFactory.class);
Logger log = LoggerFactory.getLogger(SSLContextFactory.class);
/**
* @return an {@link SSLContext} for the given configuration.

View File

@ -24,14 +24,17 @@ import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.api.core.client.ClientSession.AddressQuery;
import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Utility class to create queues 'automatically'.
*/
public class AutoCreateUtil {
private static final Logger logger = LoggerFactory.getLogger(AutoCreateUtil.class);
public static void autoCreateQueue(ClientSession session, SimpleString destAddress, SimpleString selectorString) throws ActiveMQException {
AddressQuery response = session.addressQuery(destAddress);
/* The address query will send back exists=true even if the node only has a REMOTE binding for the destination.
@ -47,7 +50,7 @@ public class AutoCreateUtil {
.setAddress(destAddress);
setRequiredQueueConfigurationIfNotSet(queueConfiguration,response, RoutingType.ANYCAST, selectorString, true);
session.createQueue(queueConfiguration);
ActiveMQClientLogger.LOGGER.debug("The queue " + destAddress + " was created automatically");
logger.debug("The queue " + destAddress + " was created automatically");
} catch (ActiveMQQueueExistsException e) {
// The queue was created by another client/admin between the query check and send create queue packet
}

View File

@ -35,7 +35,8 @@ import java.util.List;
import org.apache.activemq.artemis.core.client.ActiveMQClientLogger;
import org.apache.activemq.artemis.core.client.ActiveMQClientMessageBundle;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@ -46,7 +47,7 @@ import org.xml.sax.SAXException;
public final class XMLUtil {
private static final Logger logger = Logger.getLogger(XMLUtil.class);
private static final Logger logger = LoggerFactory.getLogger(XMLUtil.class);
private XMLUtil() {
// Utility class

View File

@ -21,13 +21,14 @@ import java.util.List;
import org.apache.activemq.artemis.api.core.TransportConfiguration;
import org.apache.activemq.artemis.uri.ConnectorTransportConfigurationParser;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.junit.Assert;
import org.junit.Test;
public class ConnectorTransportConfigurationParserURITest {
private static final Logger logger = Logger.getLogger(ConnectorTransportConfigurationParserURITest.class);
private static final Logger logger = LoggerFactory.getLogger(ConnectorTransportConfigurationParserURITest.class);
@Test
public void testParse() throws Exception {

View File

@ -113,6 +113,13 @@
<version>${project.version}</version>
</dependency>
<!-- Logging implementation -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>runtime</scope>
</dependency>
<!-- dependencies -->
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -69,6 +69,12 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-unit-test-support</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>

View File

@ -53,7 +53,6 @@
<bundle dependency="true">mvn:commons-beanutils/commons-beanutils/${commons.beanutils.version}</bundle>
<bundle dependency="true">mvn:commons-collections/commons-collections/${commons.collections.version}</bundle>
<bundle dependency="true">mvn:org.jboss.logging/jboss-logging/${jboss.logging.version}</bundle>
<bundle dependency="true">wrap:mvn:org.jgroups/jgroups/${jgroups.version}</bundle>
</feature>
@ -147,4 +146,4 @@
<bundle>mvn:org.apache.activemq/activemq-client/${activemq5-version}</bundle>
</feature>
</features>
</features>

View File

@ -101,6 +101,7 @@
<exclude>img/**/*</exclude>
<exclude>fonts/glyphicons**</exclude>
<exclude>WEB-INF/lib/guava*.jar</exclude>
<exclude>WEB-INF/classes/log4j2.properties</exclude>
</excludes>
</overlay>
</overlays>

View File

@ -1,23 +0,0 @@
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
log4j.rootLogger=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p | %t | %m%n

View File

@ -33,11 +33,21 @@
</properties>
<dependencies>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
@ -64,11 +74,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -36,22 +36,23 @@
<dependencies>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
@ -93,6 +94,7 @@
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -35,21 +35,21 @@
</properties>
<dependencies>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -49,31 +49,21 @@
<artifactId>artemis-commons</artifactId>
<version>${project.version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>test</scope>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-log-annotation-processor</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
@ -93,6 +83,12 @@
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-unit-test-support</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -33,27 +33,16 @@
<dependencies>
<!-- Logging -->
<!-- logging -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-commons</artifactId>

View File

@ -25,7 +25,8 @@ import java.util.Arrays;
import java.util.stream.Stream;
import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Class to hold common database functionality such as drivers and connections
@ -33,7 +34,7 @@ import org.jboss.logging.Logger;
@SuppressWarnings("SynchronizeOnNonFinalField")
public abstract class AbstractJDBCDriver {
private static final Logger logger = Logger.getLogger(AbstractJDBCDriver.class);
private static final Logger logger = LoggerFactory.getLogger(AbstractJDBCDriver.class);
protected SQLProvider sqlProvider;
@ -74,11 +75,11 @@ public abstract class AbstractJDBCDriver {
}
connection.commit();
} catch (SQLException e) {
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e, dropTableSql));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e, dropTableSql).toString());
try {
connection.rollback();
} catch (SQLException rollbackEx) {
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), rollbackEx, dropTableSql));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), rollbackEx, dropTableSql).toString());
throw rollbackEx;
}
throw e;
@ -87,7 +88,7 @@ public abstract class AbstractJDBCDriver {
}
private void createTableIfNotExists(String tableName, String... sqls) throws SQLException {
logger.tracef("Validating if table %s didn't exist before creating", tableName);
logger.trace("Validating if table {} didn't exist before creating", tableName);
try (Connection connection = connectionProvider.getConnection()) {
try {
connection.setAutoCommit(false);
@ -96,12 +97,12 @@ public abstract class AbstractJDBCDriver {
if (rs == null || !rs.next()) {
tableExists = false;
if (logger.isTraceEnabled()) {
logger.tracef("Table %s did not exist, creating it with SQL=%s", tableName, Arrays.toString(sqls));
logger.trace("Table {} did not exist, creating it with SQL={}", tableName, Arrays.toString(sqls));
}
if (rs != null) {
final SQLWarning sqlWarning = rs.getWarnings();
if (sqlWarning != null) {
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), sqlWarning));
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), sqlWarning).toString());
}
}
} else {
@ -109,17 +110,17 @@ public abstract class AbstractJDBCDriver {
}
}
if (tableExists) {
logger.tracef("Validating if the existing table %s is initialized or not", tableName);
logger.trace("Validating if the existing table {} is initialized or not", tableName);
try (Statement statement = connection.createStatement();
ResultSet cntRs = statement.executeQuery(sqlProvider.getCountJournalRecordsSQL())) {
logger.tracef("Validation of the existing table %s initialization is started", tableName);
logger.trace("Validation of the existing table {} initialization is started", tableName);
int rows;
if (cntRs.next() && (rows = cntRs.getInt(1)) > 0) {
logger.tracef("Table %s did exist but is not empty. Skipping initialization. Found %d rows.", tableName, rows);
logger.trace("Table {} did exist but is not empty. Skipping initialization. Found {} rows.", tableName, rows);
if (logger.isDebugEnabled()) {
final long expectedRows = Stream.of(sqls).map(String::toUpperCase).filter(sql -> sql.contains("INSERT INTO")).count();
if (rows < expectedRows) {
logger.debug("Table " + tableName + " was expected to contain " + expectedRows + " rows while it has " + rows + " rows.");
logger.debug("Table {} was expected to contain {} rows while it has {} rows.", tableName, expectedRows, rows);
}
}
connection.commit();
@ -130,9 +131,9 @@ public abstract class AbstractJDBCDriver {
return !(upperCaseSql.contains("CREATE TABLE") || upperCaseSql.contains("CREATE INDEX"));
}).toArray(String[]::new);
if (sqls.length > 0) {
logger.tracef("Table %s did exist but is empty. Starting initialization.", tableName);
logger.trace("Table {} did exist but is empty. Starting initialization.", tableName);
} else {
logger.tracef("Table %s did exist but is empty. Initialization completed: no initialization statements left.", tableName);
logger.trace("Table {} did exist but is empty. Initialization completed: no initialization statements left.", tableName);
connection.commit();
}
}
@ -141,7 +142,7 @@ public abstract class AbstractJDBCDriver {
//some DBMS just return stale information about table existence
//and can fail on later attempts to access them
if (logger.isTraceEnabled()) {
logger.trace(JDBCUtils.appendSQLExceptionDetails(new StringBuilder("Can't verify the initialization of table ").append(tableName).append(" due to:"), e, sqlProvider.getCountJournalRecordsSQL()));
logger.trace(JDBCUtils.appendSQLExceptionDetails(new StringBuilder("Can't verify the initialization of table ").append(tableName).append(" due to:"), e, sqlProvider.getCountJournalRecordsSQL()).toString());
}
try {
connection.rollback();
@ -149,7 +150,7 @@ public abstract class AbstractJDBCDriver {
logger.debug("Rollback failed while validating initialization of a table", rollbackEx);
}
connection.setAutoCommit(false);
logger.tracef("Table %s seems to exist, but we can't verify the initialization. Keep trying to create and initialize.", tableName);
logger.trace("Table {} seems to exist, but we can't verify the initialization. Keep trying to create and initialize.", tableName);
}
}
if (sqls.length > 0) {
@ -158,7 +159,7 @@ public abstract class AbstractJDBCDriver {
statement.executeUpdate(sql);
final SQLWarning statementSqlWarning = statement.getWarnings();
if (statementSqlWarning != null) {
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), statementSqlWarning, sql));
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), statementSqlWarning, sql).toString());
}
}
}
@ -167,11 +168,11 @@ public abstract class AbstractJDBCDriver {
}
} catch (SQLException e) {
final String sqlStatements = String.join("\n", sqls);
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e, sqlStatements));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e, sqlStatements).toString());
try {
connection.rollback();
} catch (SQLException rollbackEx) {
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), rollbackEx, sqlStatements));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), rollbackEx, sqlStatements).toString());
throw rollbackEx;
}
throw e;

View File

@ -25,12 +25,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.activemq.artemis.jdbc.store.logging.LoggingConnection;
import org.apache.activemq.artemis.jdbc.store.sql.PropertySQLProvider;
import org.apache.activemq.artemis.journal.ActiveMQJournalLogger;
import org.jboss.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JDBCConnectionProvider {
private static final Logger logger = Logger.getLogger(JDBCConnectionProvider.class);
private static final Logger logger = LoggerFactory.getLogger(JDBCConnectionProvider.class);
private DataSource dataSource;
private Executor networkTimeoutExecutor;
private int networkTimeoutMillis;
@ -64,7 +64,7 @@ public class JDBCConnectionProvider {
connection = new LoggingConnection(connection, logger);
}
} catch (SQLException e) {
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e).toString());
throw e;
}
@ -78,8 +78,8 @@ public class JDBCConnectionProvider {
connection.setNetworkTimeout(this.networkTimeoutExecutor, this.networkTimeoutMillis);
} catch (SQLException e) {
supportNetworkTimeout = false;
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e));
ActiveMQJournalLogger.LOGGER.warn("Unable to set a network timeout on the JDBC connection: won't retry again in the future");
logger.warn(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e).toString());
logger.warn("Unable to set a network timeout on the JDBC connection: won't retry again in the future");
} catch (Throwable throwable) {
supportNetworkTimeout = false;
//it included SecurityExceptions and UnsupportedOperationException
@ -112,7 +112,7 @@ public class JDBCConnectionProvider {
}
}
} catch (SQLException e) {
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e));
logger.error(JDBCUtils.appendSQLExceptionDetails(new StringBuilder(), e).toString());
}
}

Some files were not shown because too many files have changed in this diff Show More