繁体   English   中英

Wildfly 10 Final 无限期地创建 ActiveMQ-client-global-threads

[英]Wildfly 10 Final indefinitely creating ActiveMQ-client-global-threads

我有一个用于 JMS 的Wildfly AS设置,我正在使用 Jconsole 对其进行监控,并注意到在我什至在我的ConsumerProducer上创建会话之前,线程数一直在稳步增加,我之前出于相同目的使用了Wildfly 9 final ,即使在使用过程中,它的线程使用率也很稳定,但它出现了内存泄漏,促使我升级。

Jconsole我可以看到:

Thread-2(ActiveMQ-client-global-threads-3258368)
Thread-4(ActiveMQ-client-global-threads-3258368)
Thread-5(ActiveMQ-client-global-threads-3258368)
Thread-6(ActiveMQ-client-global-threads-3258368)
.
.
.
Thread-16(ActiveMQ-client-global-threads-3258368)

我该如何解决这个问题? 是否有我可以更改的设置导致这些线程产生,我可以从Jconsole获取更多信息来帮助我解决这个问题吗?

更新:我尝试使用此配置,但对我不起作用。 原因是 ActiveMq Artemis 使用固定线程池执行器,并且配置为 500 个线程。 在 Artemis 中进行一些更改后,它将在 Wildfly 中解决。 您可以在 Jira 中查看状态(查看最后的评论):

https://issues.jboss.org/browse/JBEAP-2947

论坛:

https://developer.jboss.org/thread/268397

解决方法:

sh standalone.sh -c standalone-full.xml -Dactivemq.artemis.client.global.thread.pool.max.size=30

原答案:

您是否尝试过设置远程连接属性?

 <connection-factory name="RemoteConnectionFactory"
 entries="java:jboss/exported/jms/RemoteConnectionFactory"
 connectors="http-connector" use-global-pools="false"
 thread-pool-max-size="10"/>

您可以针对特定用例微调 MDB,只需根据预期限制将属性useGlobalPools设置为 false 和threadPoolMaxSize

@MessageDriven(activationConfig = { 
    @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "queue/emailQueue"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "useGlobalPools", propertyValue = "false"),
    @ActivationConfigProperty(propertyName = "threadPoolMaxSize", propertyValue = "20"),
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })

如果您在 standalone.xml 中设置连接工厂属性use-global-pools="false"thread-pool-max-size="20"甚至作为 VM 参数传递,您将有一个全局行为应用于所有MDB,这可能不是一个好主意。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM