Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly 10 Final indefinitely creating ActiveMQ-client-global-threads

I have a Wildfly AS setup for JMS, I;m monitoring it with Jconsole and have noticed that before I even create a session on my Consumer or Producer the thread count is steadily increasing, I was previously using Wildfly 9 final for the same purpose, it's thread usage was steady even during use, but it had a memory leak which prompted me to upgrade.

In Jconsole I can see:

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)

How do I solve this problem? is there a setting I can change that is causing these threads to spawn, is there any more information I can take from Jconsole to help me resolve this?

like image 537
JTK Avatar asked Feb 21 '16 14:02

JTK


2 Answers

Update: I tried with this configuration and it doesn't work for me. The reason is that ActiveMq Artemis uses a fixed thread pool executor and it is configured to 500 threads. It will be solved in Wildfly after somoe changes in Artemis. You can check the status in Jira (look in the last comments):

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

Forum:

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

Workaround:

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

Original Answer:

Have you tried setting remote connection properties?

 <connection-factory name="RemoteConnectionFactory"
 entries="java:jboss/exported/jms/RemoteConnectionFactory"
 connectors="http-connector" use-global-pools="false"
 thread-pool-max-size="10"/>
like image 127
Ariel Carrera Avatar answered Dec 21 '22 14:12

Ariel Carrera


You can fine tuning the MDB for a specific use case just setting the properties useGlobalPools to false and threadPoolMaxSize according to the expected limit:

@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") })

If you set the connection factory properties use-global-pools="false" and thread-pool-max-size="20" in the standalone.xml or even pass as a VM argument, you will have a global behavior applied for all MDBs, it is maybe not a good idea.

like image 25
Renato A. Guimarães Avatar answered Dec 21 '22 13:12

Renato A. Guimarães