如何限制Glassfish v3上MDB的池大小 [英] How to restrict pool size of MDB on Glassfish v3

查看:86
本文介绍了如何限制Glassfish v3上MDB的池大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的消息驱动Bean执行高度密集型操作,所以我想限制它的池大小或者我的服务器将被重载。我已经尝试了这个(代码),但它不工作,它的池仍然是32(经验测试,我重新启动服务器,所以没有池实例)。

  @MessageDriven(mappedName =jms / TestTopic,activationConfig = {
@ActivationConfigProperty(propertyName =acknowledgeMode,propertyValue =自动确认),
@ActivationConfigProperty(propertyName =destinationType,propertyValue =javax.jms.Topic),
@ActivationConfigProperty(propertyName =subscriptionDurability,propertyValue =Durable),
@ActivationConfigProperty(propertyName =clientId,propertyValue =Reader),
@ActivationConfigProperty(propertyName =subscriptionName,propertyValue =Reader),
@ActivationConfigProperty(propertyName =endpointPoolMaxSize,propertyValue =1 ),
@ActivationConfigProperty(propertyName =endpointPoolResizeCount,propertyValue =1),
@ActivationConfigPropert y(propertyName =endpointPoolSteadySize,propertyValue =0)
})
public class Reader实现MessageListener {

我在JDK 6上的Glassfish v3上使用EJB 3,应用程序使用EE 6标准。

你能帮助我如何限制请问游泳池?感谢您的帮助。

解决方案

我会建议创建一个sun-ejb-jar.xml并将池配置放在那里。请参阅 http://www.sun。中的bean-pool。 com / software / appserver / dtds / sun-ejb-jar_3_1-0.dtd 了解原始细节。请参阅 http:// download。中的bean-pool。 oracle.com/docs/cd/E19798-01/821-1750/6nmnbjlfi/index.html 的细节,很好地抛光。


my Message Driven Bean executes highly intensive operations so I would like to restrict it's pool size or my server would have been overloaded. I have tried this ( code ) but it doesn't work, it's pool is still 32 ( empirically tested, time to time I restart a server so there are no pooled instances ).

@MessageDriven( mappedName = "jms/TestTopic", activationConfig = {
    @ActivationConfigProperty( propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge" ),
    @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Topic" ),
    @ActivationConfigProperty( propertyName = "subscriptionDurability", propertyValue = "Durable" ),
    @ActivationConfigProperty( propertyName = "clientId", propertyValue = "Reader" ),
    @ActivationConfigProperty( propertyName = "subscriptionName", propertyValue = "Reader" ),
    @ActivationConfigProperty( propertyName = "endpointPoolMaxSize", propertyValue = "1" ),
    @ActivationConfigProperty( propertyName = "endpointPoolResizeCount", propertyValue = "1" ),
    @ActivationConfigProperty( propertyName = "endpointPoolSteadySize", propertyValue = "0" )
} )
public class Reader implements MessageListener {

I am using EJB 3 on Glassfish v3 on JDK 6. Application uses EE 6 standard.

Can you help me how to restrict the pool, please? Thanks for any help.

解决方案

I would recommend creating a sun-ejb-jar.xml and put the pool configuration in there. See bean-pool in http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_1-0.dtd for the raw, gory details. See bean-pool in http://download.oracle.com/docs/cd/E19798-01/821-1750/6nmnbjlfi/index.html for the details, nicely polished.

这篇关于如何限制Glassfish v3上MDB的池大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆