How to configure HornetQ to use the native AIO libraries in JBoss EAP 6

Solution Unverified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Issue

  • How to configure HornetQ to use the native AIO libraries in JBoss EAP 6

Resolution

  • The HornetQ native libraries are available for Red Hat Enterprise Linux (RHEL) only and are contained in the Red Hat JBoss Enterprise Application Platform ... Native Components for RHEL ... on the Red Hat Customer Support Portal 1. The native libraries are one of the files listed below, one is for 32bit and the other is for 64bit. Make sure you get the correct version.
libHornetQAIO32.so - x86 32 bits
libHornetQAIO64.so - x86 64 bits

Next change the messaging subsystem to use "ASYNCIO" as shown:

from:

        <subsystem xmlns="urn:jboss:domain:messaging:1.3">
            <hornetq-server>
                <persistence-enabled>true</persistence-enabled>
                <journal-type>NIO</journal-type>

to:

        <subsystem xmlns="urn:jboss:domain:messaging:1.3">
            <hornetq-server>
                <persistence-enabled>true</persistence-enabled>
                <journal-type>ASYNCIO</journal-type>

See the diagnostic steps for how to confirm everything is setup and configured correctly.

If ASYNCIO is specified as the journal-type but the native library is not found, JBoss EAP will log a warning as shown in the diagnostic steps and then will fall back to using NIO.

Diagnostic Steps

The messaging subsystem has some logging that will then be printed.

  • If you do not have the native libraries installed, you will see:
WARN  [org.jboss.as.messaging] (MSC service thread 1-5) JBAS011600: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
...
INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221013: Using NIO Journal
  • If you have them installed and have journal-type set to ASYNCIO, you will see:
INFO  [org.hornetq.core.server] (MSC service thread 1-3) HQ221012: Using AIO Journal
  • If you have journal-type set to NIO or i, you will see:
INFO  [org.hornetq.core.server] (MSC service thread 1-4) HQ221013: Using NIO Journal
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.