我们在wildfly10的standalone-full.xml中有以下配置。
<subsystem xmlns="urn:jboss:domain:ejb3:4.0">
<session-bean>
<stateless>
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
</stateless>
<stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
<singleton default-access-timeout="5000"/>
</session-bean>
<mdb>
<resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="ExchangeMessagePool" max-pool-size="10" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
</bean-instance-pools>
</pools>
</subsystem>我们有以下消息驱动的bean,它与交换消息pool.In链接在一起,from.Is - this.If -full.xml我们将最大池大小设置为10,但是在服务器启动期间创建的实例数量是30,但我不知道它会从哪里来,有没有办法限制this.If,有任何方法可以限制在standalone-full文件中访问这个bean的并发线程的数量。
@MessageDriven(name = "ExchangeMessage", activationConfig = {@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/queue/ExchangeMessageQueue")})
@PermitAll
@Pool("ExchangeMessagePool")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@TransactionManagement(TransactionManagementType.CONTAINER)
public class ExchangeMessageBean implements MessageListener
{
...
}发布于 2017-11-06 01:39:27
如果你不指定@ResourceAdapter,它会使用默认的名为"activemq-ra“的池连接工厂,它有自己的默认值,或者除了你指定的池之外还使用它的默认值(我认为是15),或者两者兼而有之。您可以用maxSessions=" n“注释MDB,这会将并行实例的数量限制为n。
https://stackoverflow.com/questions/38629789
复制相似问题