我想知道在哪里可以增加Max
中thread
Jboss AS 6.1.0.Final
的数量。
我通过谷歌浏览,但找不到确切的答案,那里提到的文件和位置不正确。
答案 0 :(得分:0)
这是通过Tomcat Executor完成的。您可以在Thread Pool Configuration in AS 6.x中阅读详细信息。
可以写一个独立的描述符,其名称是“jboss-threads.xml”或以“jboss-threads.xml”结尾。这种描述符的格式如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
替代方案:您可以将其包含在Microcontainer部署中。
由于Microcontainer处理XML部署的方式,可以在常规POJO部署中包含您的线程描述符,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<!-- JBossMC elements here -->
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
</deployment>