ARTEMIS-2477 - create a less verbose and more descriptive warning when the native Netty jars are not present on the classpath

https://issues.apache.org/jira/browse/ARTEMIS-2477
This commit is contained in:
Andy Taylor 2019-09-09 11:11:21 +01:00 committed by Clebert Suconic
parent 298ad01b4f
commit 9a1a2b1369
2 changed files with 15 additions and 0 deletions

View File

@ -410,6 +410,15 @@ public interface ActiveMQClientLogger extends BasicLogger {
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)
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)
void unableToCheckEpollAvailabilitynoClass();
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT)

View File

@ -34,6 +34,9 @@ public class CheckDependencies {
public static final boolean isEpollAvailable() {
try {
return Env.isLinuxOs() && Epoll.isAvailable();
} catch (NoClassDefFoundError noClassDefFoundError) {
ActiveMQClientLogger.LOGGER.unableToCheckEpollAvailabilitynoClass();
return false;
} catch (Throwable e) {
ActiveMQClientLogger.LOGGER.unableToCheckEpollAvailability(e);
return false;
@ -43,6 +46,9 @@ public class CheckDependencies {
public static final boolean isKQueueAvailable() {
try {
return Env.isMacOs() && KQueue.isAvailable();
} catch (NoClassDefFoundError noClassDefFoundError) {
ActiveMQClientLogger.LOGGER.unableToCheckKQueueAvailabilityNoClass();
return false;
} catch (Throwable e) {
ActiveMQClientLogger.LOGGER.unableToCheckKQueueAvailability(e);
return false;