Websphere. Get thread pool ID

2019-05-19 13:57发布

问题:

I need to build string with the following pattern:

<Server>;<Node>;<Cell>;<Version>;<MessageListenerThreadPool-ID>;<ORBThreadPool-
ID>;<WebcontainerThreadPool-ID>;<TCPChannelsThreadPool-ID>

So I need to write the ID's of several standard thread pools, but I can't find any information about thread-pools Id's. I found only thread-pool names. May be somebody knows where I can find information about thread-pool Id's?

Thanks!

P.S. I'm using Websphere 7.x

回答1:

Use JMX to obtain management objects (JSR-77: J2EETM Management). Example of obtaining them from Websphere is given at http://www.ibm.com/developerworks/websphere/techjournal/0402_qiao/0402_qiao.html.

This API will help you to access JXM.

First find if object are accessible via Administrative console. Then look at list of objects that you'll receive from server via JMX API call.



回答2:

There does't appear to be a threadpool ID associated with the JMX object; just a threadpool name. You can write a script similar to the one below to list threadpools and their attributes.

wsadmin>pools = AdminConfig.list('ThreadPool').split()
wsadmin>for pool in pools:
wsadmin>        print pool
wsadmin>        print
wsadmin>
Default(cells/cluentiusNode12Cell/nodes/node2/server/provider1|server.xml#ThreadPool_1183121908658)


HAManagerService.Pool(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|hamanagerservice.xml#ThreadPool_1080665401693)

Message.Listener.Pool(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|server.xml#ThreadPool_1183121908663)

ORB.thread.pool(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|server.xml#ThreadPool_1183121908656)

... snip ...

WMQJCAResourceAdapter(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|server.xml#ThreadPool_1332907301375)

WebContainer(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|server.xml#ThreadPool_1183121908657)

server.startup(cells/cluentiusNode12Cell/nodes/node2/servers/provider1|server.xml#ThreadPool_1183121908662)

wsadmin>print AdminConfig.show(pools[9])
[customProperties []]
[inactivityTimeout 60000]
[isGrowable false]
[maximumSize 10]
[minimumSize 5]
[name WebContainer]
wsadmin>

The show() command shows the attributes you do have available to you.



回答3:

I found answer to my question.

Thread-pool ID can be obtained from JConsole, under Threadpool node. There many thread-pools, and thread-pools Mbeans listed in question have an objectName attribute, like this:

WebSphere:name=ORB.thread.pool,process=server1,platform=dynamicproxy,.......server.xml#ThreadPool_1183122130078,cell=someCell,spec=1.0

In this case Thread-pool ID is 1183122130078.

Thanks all.