I have multiple MDB (message-driven-beans) in Wildfly that I want to monitor, and I'm looking for a way to get the current number of in-use bean instances for each MDB.
I'm currently getting MDB data/stats from Wildfly with the follwing --command:
/deployment=my-ear.ear/subdeployment=com.test.my-ejb.jar/subsystem=ejb3/message-driven-bean=*/:read-resource(include-runtime=true)" --output-json
Returning approx. (Only showing result for one MDB):
{
"outcome": "success",
"result": [
{
"address": [
{
"deployment": "my-ear.ear"
},
{
"subdeployment": "com.test.my-ejb.jar"
},
{
"subsystem": "ejb3"
},
{
"message-driven-bean": "MyMDB"
}
],
"outcome": "success",
"result": {
"activation-config": [
{
"destinationLookup": "my_queue"
},
{
"acknowledgeMode": "Auto-acknowledge"
},
{
"destinationType": "jakarta.jms.Queue"
},
{
"maxSession": "3"
}
],
"component-class-name": "no.test.MyMDB",
"declared-roles": [],
"delivery-active": true,
"execution-time": 0,
"invocations": 0,
"message-destination-link": null,
"message-destination-type": null,
"messaging-type": "jakarta.jms.MessageListener",
"methods": {},
"peak-concurrent-invocations": 0,
"pool-available-count": 5,
"pool-create-count": 0,
"pool-current-size": 0,
"pool-max-size": 5,
"pool-name": "my-pool",
"pool-remove-count": 0,
"run-as-role": null,
"security-domain": "other",
"timeout-method": null,
"timers": [],
"transaction-type": "CONTAINER",
"wait-time": 0,
"service": null
},
"rolled-back": null
}
]
}
But there is no information about the current number of in-use bean instances.
There is the attribute pool-current-size but this attribute seems to include idle bean instances.
Is there a way to get the number of in-use bean instances from Wildfly, or a way to extrapolate the number by using other attributes? Maybe is the way to use the pool-current-size but reduce idle time for bean instances?