How to dynamically change JMS queue MDB pool size in WildFly 10

[亡魂溺海] 提交于 2019-12-02 03:44:41

问题


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?


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!