How to configure EJB Async and EJB Timers to use a separate thread pool in JBoss EAP 7 / 6

Solution Unverified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6

Issue

  • How to configure EJB Async and EJB Timers to use a separate thread pool in JBoss EAP 7 / 6
  • How to verify the EJB Async thread creation?

Resolution

First, create thread pool for async EJBs to use and configure the async service to use them with these CLI commands:

/subsystem=ejb3/thread-pool=async:add(max-threads=50)
/subsystem=ejb3/service=async:write-attribute(name=thread-pool-name, value=async)

Which changes the JBoss profile xml configuration to:

        <subsystem xmlns="urn:jboss:domain:ejb3:5.0">
            ...
            <async thread-pool-name="async"/>
            <thread-pools>
                ...
                <thread-pool name="async">
                    <max-threads count="50"/>
                </thread-pool>
                ...
            </thread-pools>

To verify the creation, use the command /subsystem=ejb3:read-resource at the jboss-cli and see thread-pool section:

        "thread-pool" => {
            "default" => undefined,
            "async" => undefined
        }

Secondly, create thread pool for EJB timers to use and configure the timer-service to use them with these CLI commands:

/subsystem=ejb3/thread-pool=timer:add(max-threads=30)
/subsystem=ejb3/service=timer-service:write-attribute(name=thread-pool-name,value=timer)

Which changes the JBoss profile xml configuration to:

        <subsystem xmlns="urn:jboss:domain:ejb3:5.0">
            ...
            <timer-service thread-pool-name="timer" default-data-store="default-file-store">
                ...
            </timer-service>
            ...
            <thread-pools>
                ...   
                <thread-pool name="timer">
                    <max-threads count="30"/>
                </thread-pool>
                ...
            </thread-pools>
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.