I am working with WildFly 10.1 which ships with Artemis as the new JMS provider but I am unable to find how to dynamically change the number of consumer threads for a specific MDB.
I have a queue, and a message listener (MDB) consuming messages from the queue, now I want to dynamically control the maximum number of consumers threads the domain must start.
How can I do it using CLI?
As you want to do this configuration for a specific MDB you could firstly assign it to a dedicated pool. See this answer.
Then to dynamically update your pool attributes you could take a look at this article which describes how to configure or add ejb3 pools using jboss-cli or standalone.xml configuration. (with JBOSS 7, but it should not be so different with Wildfly 10)
The following jboss-cli command could then be used to modify your pool size dynamycally as it defaults to 20 for MDBs:
/subsystem=ejb3/strict-max-bean-instance-pool=myPool:write-attribute(name=max-pool-size)
Finally, it seems you also have to configure the 'maxSession' activation configuration property accordingly in your MDB. See this thread and also this question for contextual configuration.
来源:https://stackoverflow.com/questions/40806160/how-to-dynamically-change-jms-queue-mdb-pool-size-in-wildfly-10