在 JBoss EAP 5.1 中为特定 MDB 配置 maxSession 属性 [英] Making maxSession property configurable for a specific MDB in JBoss EAP 5.1

查看:21
本文介绍了在 JBoss EAP 5.1 中为特定 MDB 配置 maxSession 属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为 MDB 用户配置 maxSession 值?

How to make maxSession value for an MDB user-configurable?

有一个 MDB 可以侦听来自特定队列的消息.它被定义为一个注解.

There is an MDB that listens for a message from a specific queue. It is defined as an annotation.

@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "5").

为了改变maxSession的值,每次都要编译代码.

In order to change the value of the maxSession, the code has to be compiled everytime.

有没有办法让它由用户配置,这样就不需要构建,也不需要重新启动 jboss?

Is there a way to make it user configurable so that there is no build required and without restarting jboss?

请帮忙.

推荐答案

这是从耳朵外部化此设置的方法:

This is the way to externalize this setting from ear:

https://community.jboss.org/thread/178162

但是仍然需要重启.

更新

发现一种方法ejb中应用带有系统属性引用的新maxSession-jar.xml:

<activation-config-property>
   <activation-config-property-name>maxSession</activation-config-property-name>
   <activation-config-property-value>${my.mdb.maxSession:30}</activation-config-property-value>
</activation-config-property>

不需要完全重启 JBoss,在这种情况下只需要重新部署耳朵.

Full JBoss restart is not required, only ear redeploy is needed in this case.

它适用于所有 JBoss 版本直到 JBoss AS 7.

It works for all JBoss versions until JBoss AS 7.

请注意,maxSession 必须与最大池大小同步:https://community.jboss.org/message/549083#549083

Note that maxSession must be in sync with max pool size: https://community.jboss.org/message/549083#549083

这篇关于在 JBoss EAP 5.1 中为特定 MDB 配置 maxSession 属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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