Let's assume that you already started a JBoss AS 7 instance, created a user in the Management Realm for RHQ agent (with add-user script) and imported this instance in RHQ server.
Don't forget to configure the user credentials under the Connection Settings tab.
|AS 7 Connection Settings|
By default, the JBoss Web subsystem uses an internal thread pool and does not expose many properties through the management interface. What we need to do is creating a dedicated thread pool in the Threads subsystem and configure it to be the web connector executor.
Create a thread factoryWouldn't it be nice to give connector threads an eloquent name? A dedicated thread factory will help. Under the Inventory > Child Resources tab of the Threads subsystem page, create a new child of ThreadFactory type:
|Create child of ThreadFactory type|
Give this thread factory a name and adjust the Thread Name Pattern as you wish:
|ThreadFactory creation wizard|
Create and configure a thread poolThis is the core part. Under the Inventory > Child Resources tab of the Threads subsystem page, create a new child of ThreadPool type. Choose the unbounded-queue-thread-pool template and don't forget to link with your thread factory:
|ThreadPool creation wizard|
Once the thread pool has been created and the new resource discovered by RHQ, enable measurements (only availability check is enabled by default). I chose to keep the default value for total counts and check active threads count every 30 seconds:
|ThreadPool Monitoring Schedules|
Configure the web connector
Almost done! Configure the web connector to use the new thread pool as executor:
|Web Connector configuration|
Thread pool metricsThat's it! Now you can see your metrics collected:
|Web Connector Executor metrics|