Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making maxSession property configurable for a specific MDB in JBoss EAP 5.1

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.

like image 359
Prasenjit Avatar asked Oct 11 '22 01:10

Prasenjit


1 Answers

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

like image 94
Vadzim Avatar answered Oct 20 '22 05:10

Vadzim