首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过wildfly 10 standalone-full.xml限制ejb mdb(messsage driven beans)实例

如何通过wildfly 10 standalone-full.xml限制ejb mdb(messsage driven beans)实例
EN

Stack Overflow用户
提问于 2016-07-28 15:30:27
回答 1查看 1.2K关注 0票数 1

我们在wildfly10的standalone-full.xml中有以下配置。

代码语言:javascript
复制
 <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的并发线程的数量。

代码语言:javascript
复制
@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
{
...
}
EN

回答 1

Stack Overflow用户

发布于 2017-11-06 01:39:27

如果你不指定@ResourceAdapter,它会使用默认的名为"activemq-ra“的池连接工厂,它有自己的默认值,或者除了你指定的池之外还使用它的默认值(我认为是15),或者两者兼而有之。您可以用maxSessions=" n“注释MDB,这会将并行实例的数量限制为n。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38629789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档