21.3. Configuring EJB Thread Pools
21.3.1. Enterprise Bean Thread Pools
21.3.2. Create a Thread Pool
Procedure 21.10. Create an EJB Thread Pool using the Management Console
- Login to the Management Console. Section 3.3.2, “Log in to the Management Console”
- Click on the tab at the top of the screen.
- Expand the menu and select .
- Select the tab and click .
- Specify the Name and Max Threads values.
- Click to finish.
Procedure 21.11. Create a Thread Pool using the CLI
- Launch the CLI tool and connect to your server. Refer to Section 3.4.4, “Connect to a Managed Server Instance Using the Management CLI”.
- Use the
addoperation with the following syntax./subsystem=ejb3/thread-pool=THREAD_POOL_NAME:add(max-threads=MAX_SIZE)
- Replace THREAD_POOL_NAME with the name of the thread pool.
- Replace MAX_SIZE with the maximum size of the thread pool.
- Use the
read-resourceoperation to confirm the creation of the bean pool./subsystem=ejb3/thread-pool=THREAD_POOL_NAME:read-resource
Example 21.7. Create a Thread Pool using the CLI
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=my-test-pool:add(max-threads=20)
{"outcome" => "success"}
Example 21.8. XML Configuration Sample
<subsystem xmlns="urn:jboss:domain:ejb3:1.5">
...
<thread-pools>
...
<thread-pool name="my-test-pool" max-threads="20"/>
</thread-pools>
...
</subsystem>21.3.3. Remove a Thread Pool
Prerequisites
- The thread pool that you want to remove cannot be in use. Refer to the following tasks to ensure that the thread pool is not in use:
Procedure 21.12. Remove an EJB thread pool using the Management Console
- Login to the Management Console. Section 3.3.2, “Log in to the Management Console”.
- Click on the tab at the top of the screen. Expand the menu and select . Select the tab.
- Select the thread pool to you want to remove.
- Click . The Remove Item dialog appears.
- Click .
Procedure 21.13. Remove a thread pool using the CLI
- Launch the CLI tool and connect to your server. Refer to Section 3.4.4, “Connect to a Managed Server Instance Using the Management CLI”.
- Use the
removeoperation with the following syntax./subsystem=ejb3/thread-pool=THREADPOOLNAME:remove
- Replace THREADPOOLNAME with the name of the thread pool.
Example 21.9. Removing a Thread Pool using the CLI
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=ACCTS_THREADS:remove
{"outcome" => "success"}
21.3.4. Edit a Thread Pool
Procedure 21.14. Edit a Thread Pool using the Management Console
- Login to the Management Console. Section 3.3.2, “Log in to the Management Console”.
- Click on the tab at the top of the screen. Expand the menu and select . Select the tab.
- Select the thread pool you want to edit.
- Click .
- Edit the details you want to change. Only the
Thread Factory,Max Threads,Keepalive Timeout, andKeepalive Timeout Unitvalues can be edited. - Click to finish.
Procedure 21.15. Edit a thread pool using the CLI
- Launch the CLI tool and connect to your server. Refer to Section 3.4.4, “Connect to a Managed Server Instance Using the Management CLI”.
- Use the
write_attributeoperation with the following syntax for each attribute of the thread pool to be changed./subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="ATTRIBUTE", value="VALUE")
- Replace THREADPOOLNAME with the name of the thread pool.
- Replace ATTRIBUTE with the name of the attribute to be edited. The attributes that can be edited in this way are
keepalive-time,max-threads, andthread-factory. - Replace VALUE with the required value of the attribute.
- Use the
read-resourceoperation to confirm the changes to the thread pool./subsystem=ejb3/thread-pool=THREADPOOLNAME:read-resource
Important
keepalive-time attribute with the CLI the required value is an object representation. It has the following syntax.
/subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="keepalive-time", value={"time" => "VALUE","unit" => "UNIT"}Example 21.10. Set the Maxsize Value of a Thread Pool using the CLI
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="max-threads", value="50")
{"outcome" => "success"}
Example 21.11. Set the keepalive-time Time Value of a Thread Pool using the CLI
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="keepalive-time", value={"time"=>"150"})
{"outcome" => "success"}

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.