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

查看:127
本文介绍了使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-jar.xml中使用系统属性引用来应用新的maxSession

<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天全站免登陆