Search code examples
hornetqaio

HornetQ not using AIO on ubuntu


I have installed libaio on ubuntu, and running HornetQ embedded, with programmatic config, I am doing this to use AIO on journal, but I see on startup, it's not getting AIO, always using NIO. Any way to determine why it would be failing?

        Configuration configuration = new ConfigurationImpl();
        boolean supportsAIO = AIOSequentialFileFactory.isSupported();
        if (supportsAIO) {
            configuration.setJournalType(JournalType.ASYNCIO);
            log.info("** using AIO **");
        } else {
            configuration.setJournalType(JournalType.NIO);
            log.info("** using NIO **");
        }

Solution

  • You have to define -Djava.library.path=PathToYourBinaries

    and you should have these files at PathToYourBinaries:

    • libHornetQAIO32.so
    • libHornetQAIO64.so

    if you still can't load it then it will be a matter of recompiling the natives at your system, but most likely you just need to define java.library.path.