如何限制 Glassfish v3 上 MDB 池的大小
我的消息驱动 Bean 执行高度密集的操作,因此我想限制它的池大小,否则我的服务器会过载。我已经尝试过这个(代码),但它不起作用,它的池仍然是32(根据经验测试,我不时重新启动服务器,因此没有池实例)。
@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 {
我在 JDK 6 上的 Glassfish v3 上使用 EJB 3。应用程序使用 EE 6 标准。
你能帮我看看如何限制池吗?感谢您的任何帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议创建一个 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 了解详细信息,精心打磨。
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.
我关注了 @vkraemer 发布的链接,下面是我的代码片段。似乎还需要steady-pool-size和resize-quantity,因为它们的默认值与较低的最大池大小不兼容。
但请注意:
...来自 GlassFish 性能调整指南
I followed links posted by @vkraemer and bellow is my code snippet. It seems that
steady-pool-size
andresize-quantity
are needed as well because their default values are not compatible with low max pool size.But be aware of:
... from GlassFish performance-tuning-guide