This commit is contained in:
Clebert Suconic 2019-09-09 17:43:03 -04:00
commit d888e91cf2
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;