How to make maxSession value for an MDB user-configurable?
There is an MDB that listens for a message from a specific queue. It is defined as an annotation.
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "5")
.
In order to change the value of the maxSession, the code has to be compiled everytime.
Is there a way to make it user configurable so that there is no build required and without restarting jboss?
Kindly help.
This is the way to externalize this setting from ear:
https://community.jboss.org/thread/178162
But restart is still required.
Update
Found a way to apply new maxSession with system property reference in ejb-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>
Full JBoss restart is not required, only ear redeploy is needed in this case.
It works for all JBoss versions until JBoss AS 7.
Note that maxSession must be in sync with max pool size: https://community.jboss.org/message/549083#549083
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With