I have resource adapter in wildfly-teiid-server with xml
<resource-adapter id="salesforcefour" statistics-enabled="true">
<module slot="main" id="org.jboss.teiid.resource-adapter.salesforce-41"/>
<connection-definitions>
<connection-definition class-name="org.teiid.resource.adapter.salesforce.SalesForceManagedConnectionFactory" jndi-name="java:/sfDS41" enabled="true" connectable="true" use-java-context="true" pool-name="sfDS41">
<config-property name="connectTimeout">30000</config-property>
<config-property name="password"></config-property>
<config-property name="URL">https://test.salesforce.com/services/Soap/u/45.0</config-property>
<config-property name="requestTimeout">120000</config-property>
<config-property name="username"></config-property>
<pool>
<min-pool-size>5</min-pool-size>
<initial-pool-size>5</initial-pool-size>
<prefill>true</prefill>
<use-strict-min>true</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
</connection-definition>
</connection-definitions>
</resource-adapter>
For checking that connection pool really get active connections I need get statistics.
I tied to execute jboss-cli.sh and commends
/subsystem=resource-adapters/resource-adapter=salesforcefour:write-attribute(name=statistics-enabled,value=true)
/subsystem=resource-adapters/statistics=statistics/connection-definitions=java\:\/sfDS41:read-resource(include-runtime=true)
But get error
Failed to get the list of the operation properties: "WFLYCTL0030: No resource definition is registered for address [
("subsystem" => "resource-adapters"),
("statistics" => "statistics"),
("connection-definitions" => "java:/sfDS41")
]"
How to check connection pool statistics or just get current active connections count?
Answer from https://github.com/teiid/teiid/pull/1335
For non-jdbc resource adapters it is specified on the pool for the given connection definition:
/subsystem=resource-adapters/resource-adapter=salesforcefour/connection-definitions=sfDS/statistics=pool:write-attribute(name=statistics-enabled, value=true)
You just need to substitute in the name of the connection definition you used - that is the logical name, which is likely not the jndi name. You can auto complete on subsystem=resource-adapters/resource-adapter=salesforcefour/connection-definitions= to see your connection definition names. You should then be able to read the pool statistics against that connection definition name.